ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can you set 2 ranges to both be from the same cell? (https://www.excelbanter.com/excel-programming/415743-can-you-set-2-ranges-both-same-cell.html)

Simon[_2_]

Can you set 2 ranges to both be from the same cell?
 
Seeing the example may make more sense

MyWBConvertor.Activate
Dim MyPath3 As String, MyRange3 As Range
Dim MyPath4 As String, MyRange4 As Range
MyPath3 = MyWBConvertor.Path
MyPath4 = MyWBConvertor.Path
Set MyRange3 = MyWBConvertor.ActiveSheet.Range("D25") '2 months ago
Set MyRange4 = MyWBConvertor.ActiveSheet.Range("C26") 'Year

MyWBConvertor.Activate
Dim MyPath As String, MyRange As Range
Dim MyPath2 As String, MyRange2 As Range
MyPath = MyWBConvertor.Path
MyPath2 = MyWBConvertor.Path
Set MyRange = MyWBConvertor.ActiveSheet.Range("C25") ' Last month
Set MyRange2 = MyWBConvertor.ActiveSheet.Range("C26") ' Year

Bob Phillips

Can you set 2 ranges to both be from the same cell?
 
Yes, trying it would tell you that.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Simon" wrote in message
...
Seeing the example may make more sense

MyWBConvertor.Activate
Dim MyPath3 As String, MyRange3 As Range
Dim MyPath4 As String, MyRange4 As Range
MyPath3 = MyWBConvertor.Path
MyPath4 = MyWBConvertor.Path
Set MyRange3 = MyWBConvertor.ActiveSheet.Range("D25") '2 months ago
Set MyRange4 = MyWBConvertor.ActiveSheet.Range("C26") 'Year

MyWBConvertor.Activate
Dim MyPath As String, MyRange As Range
Dim MyPath2 As String, MyRange2 As Range
MyPath = MyWBConvertor.Path
MyPath2 = MyWBConvertor.Path
Set MyRange = MyWBConvertor.ActiveSheet.Range("C25") ' Last month
Set MyRange2 = MyWBConvertor.ActiveSheet.Range("C26") ' Year





All times are GMT +1. The time now is 10:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com