Another way of writing a range in excel

Chris6629

New Member
Joined
Sep 22, 2014
Messages
4
'A range in Summary Tab
Sheets("Summary").Range("A3:A35") 'first way

'It can also be written in another way using Cells (x,y)
Sheets("Summary").Range(Cells(3,1),Cells(35,1)) 'another way

'Another range in Summary Tab
Sheets("Summary").Range("A3:A35,JA3:JA35")

'Question : How this range can be witten in the other way? Using Cells(x,y)?

Thanks you
Chris6629
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
This is not correct:
Code:
Sheets("Summary").Range(Cells(3,1),Cells(35,1))
It should be:
Code:
Sheets("Summary").Range(Sheets("Summary").Cells(3,1),Sheets("Summary").Cells(35,1))

You can't directly convert your final example, you have to use Union:
Code:
Union(Sheets("Summary").Range(Sheets("Summary").Cells(3,1),Sheets("Summary").Cells(35,1)), Sheets("Summary").Range(Sheets("Summary").Cells(3,"JA"),Sheets("Summary").Cells(35,"JA")))
 
Upvote 0
You can't directly convert your final example, you have to use Union:
Code:
Union(Sheets("Summary").Range(Sheets("Summary").Cells(3,1),Sheets("Summary").Cells(35,1)), Sheets("Summary").Range(Sheets("Summary").Cells(3,"JA"),Sheets("Summary").Cells(35,"JA")))
This kind of matches what the OP was asking for (the Resize is "new") and seems to work as well...

Code:
Sheets("Summary").Range(Sheets("Summary").Cells(3,1).Resize(33).Address & "," & Sheets("Summary").Cells(35,10).Resize(33).Address)
 
Upvote 0

Forum statistics

Threads
1,214,895
Messages
6,122,128
Members
449,066
Latest member
Andyg666

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top