Need to Select multiple cells based on counter

S

Skyron

Hey,

I'm having trouble finding how to make a selection of cells usin
integer values rather than text

i.e.
Range("A1:A5")

Is there a way to use Range with integer values?
I need to make selections of cells based on an integer counter in a VB
Script

Thanks!!
 
K

kkknie

A couple of ways:

For only one column -

Range("A" & iFirstRow & ":A" & iLastRow)

where ifirstrow and ilastrow are the row range. Or-

Range(Cells(iFirstRow, iFirstCol), Cells(iLastRow, iLastCol))

to select from multiple contiguous rows and columns.
 
B

Bob Phillips

Range(Cells(1,1),Cells(5,1))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
J

Juan Pablo González

I find it easier to use the Cells() object, something like

Cells(myrownumber, mycolumnnumber)
 
Top