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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
40,375
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
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

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
38,150
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
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,191,025
Messages
5,984,195
Members
439,877
Latest member
kellylet

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
Top