Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
newbie range question
Hello,
I am new to vba and want to write a function that takes a range of cells as the argument. In VBA I want to be able to mostly access the value in the first cell, and the value in the last cell. Do I want to use the 'range' type for this? By playing around, it seems ".value" gives me the value in the first cell. Is there a way to get the value in the last cell of the range? thanks for any help, scott |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
newbie range question
A range object should work for you. What you need is to access the item to
select the appropraite cells, something like this... dim rng as Range set rng = Sheets("Sheet1").Range("A1:C10") with rng msgbox .value 'This one you know about msgbox .item(.count).value 'The last item in the range end with -- HTH... Jim Thomlinson " wrote: Hello, I am new to vba and want to write a function that takes a range of cells as the argument. In VBA I want to be able to mostly access the value in the first cell, and the value in the last cell. Do I want to use the 'range' type for this? By playing around, it seems ".value" gives me the value in the first cell. Is there a way to get the value in the last cell of the range? thanks for any help, scott |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Newbie Question | New Users to Excel | |||
Real Newbie newbie question | New Users to Excel | |||
Newbie Question - Subtraction Formula Question | Excel Discussion (Misc queries) | |||
Looping through range newbie question | Excel Programming | |||
Newbie question | Excel Programming |