Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-03-2022, 05:08 AM
soroush.kalantari soroush.kalantari is offline How to set a range which its and last interval are parameters not texts؟ Windows 10 How to set a range which its and last interval are parameters not texts؟ Office 2016
Competent Performer
How to set a range which its and last interval are parameters not texts؟
 
Join Date: Jun 2021
Posts: 115
soroush.kalantari is on a distinguished road
Default How to set a range which its and last interval are parameters not texts؟

I have written a macro, in a part of it, I want to set a range which its first and last interval are parameters not texts. (the value of cell03 and cell04 are $R46 and $R46 respectively.). But when running the code, the excel encounters an error saying “Run time error 1004,method range of object global failed. Can anybody Guides me on this issue? (the part of Macro whit this problem is as follow:

nb = Range("g8").Value
nba = Range("g9").Value
Range("R1").Select
ActiveCell.Offset(nsalesam, 0).Activate
cell01 = ActiveCell.Address(0, 1)
ActiveCell.Offset(nproducts01, 0).Activate


cell02 = ActiveCell.Address(0, 1)
Set products = Range("&cell01&:&cell02&")

Last edited by soroush.kalantari; 04-03-2022 at 07:50 PM.
Reply With Quote
  #2  
Old 04-04-2022, 07:14 AM
Debaser's Avatar
Debaser Debaser is offline How to set a range which its and last interval are parameters not texts؟ Windows 7 64bit How to set a range which its and last interval are parameters not texts؟ Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

I think you actually wanted something like this

Code:
Set products = Range(cell01, cell02)
Reply With Quote
  #3  
Old 04-05-2022, 03:37 AM
soroush.kalantari soroush.kalantari is offline How to set a range which its and last interval are parameters not texts؟ Windows 10 How to set a range which its and last interval are parameters not texts؟ Office 2016
Competent Performer
How to set a range which its and last interval are parameters not texts؟
 
Join Date: Jun 2021
Posts: 115
soroush.kalantari is on a distinguished road
Default

@ Debaser. Thank you very much. Your reply solved the problem.
Reply With Quote
Reply

Tags
interval, set

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Raw interval during fractional numbers andriy-datsyuk@ukr.net Word 0 01-05-2019 02:08 PM
Email Merge With Interval Between Emails row2809 Mail Merge 0 07-11-2017 12:48 PM
How to set a range which its and last interval are parameters not texts؟ Trendline parameters Gilles Excel 2 01-04-2017 08:02 AM
How to pass parameters to a .msg file? HereNow Outlook 0 11-05-2012 10:38 AM
Constraining a fixed interval between two tasks Doug Sanderson Project 3 08-30-2011 09:01 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:49 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft