Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2006

Tip: Looking for answers? Try searching our database.

newbie range question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
scott.siegler@gmail.com - 28 Feb 2006 20:24 GMT
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
Jim Thomlinson - 28 Feb 2006 22:30 GMT
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
Signature

HTH...

Jim Thomlinson

> Hello,
>
[quoted text clipped - 7 lines]
> thanks for any help,
> scott
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.