Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default value of a cell on VB

myValueFromA1 = Worksheets("sheetName").Range("A1").Value

that is the most formal way of referring to the value in A1 on a sheet.
Since .Value is the default property you could shorten it to:

myValueFromA1 = Worksheets("sheetName").Range("A1")

and if the code is associated with the sheet itself, then
myValueFromA1 = Range("A1")
is acceptable.

If you are certain that the sheet with the A1 cell you are interested in is
the currently selected sheet (absolutely certain) then
myValueFromA1 = ActiveSheet.Range("A1")
would work.


"Ross" wrote:

How do I get into VB the value of a cell?
More specifically: suppose I need to write a web query, where I need to
specify an address where a piece of it is the entry of cell A1?

thanks!!
Ross


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cell References [email protected] Excel Discussion (Misc queries) 2 November 15th 06 11:37 PM
Using an offset formula for the reference in a relative reference Cuda Excel Worksheet Functions 6 November 15th 06 05:12 PM
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Instead of a negative number, I'd like to show zero... Dr. Darrell Excel Worksheet Functions 6 December 7th 05 08:21 PM
cell color index comparison MINAL ZUNKE New Users to Excel 1 June 30th 05 07:11 AM


All times are GMT +1. The time now is 05:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"