#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
I think you actually wanted something like this
Code:
Set products = Range(cell01, cell02) |
#3
|
|||
|
|||
@ Debaser. Thank you very much. Your reply solved the problem.
|
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 |
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 |