B
bretthotep
Hi everybody,
I have a problem,
I have written some code where I am trying to access a row and the
individual cells within that row
sub cellTest()
dim cellRng as Range
dim wrkSht as Worksheet
dim cellVal as variant
set cellRng = Worksheets("Sheet 1").Rows(1)
'this function runs and should return a range of cells from row 1 in
Sheet 1 however does not.
'get the first cell in the range
set cellVal = cellRng(1)
'output the value
Msgbox "value is " & cellVal.Value "."
end sub
Can somebody help me, can I use a range like this or do I have to run a
loop picking out all the cells individually from the row.
Thanks,
I have a problem,
I have written some code where I am trying to access a row and the
individual cells within that row
sub cellTest()
dim cellRng as Range
dim wrkSht as Worksheet
dim cellVal as variant
set cellRng = Worksheets("Sheet 1").Rows(1)
'this function runs and should return a range of cells from row 1 in
Sheet 1 however does not.
'get the first cell in the range
set cellVal = cellRng(1)
'output the value
Msgbox "value is " & cellVal.Value "."
end sub
Can somebody help me, can I use a range like this or do I have to run a
loop picking out all the cells individually from the row.
Thanks,