+ Reply to Thread
Results 1 to 2 of 2

Reference to cell - VBA

  1. #1
    Darryl Kirtland
    Guest

    Reference to cell - VBA

    Hi

    I'm trying to write a user defined function which references a cell in sheet
    1 in my spreadsheet. Cell A10 currently has the value of 20 - how do I
    reference this cell in my VBA program.

    Thanks

    Darryl



  2. #2
    Registered User
    Join Date
    08-24-2005
    Posts
    26

    try this

    Try this:

    Please Login or Register  to view this content.
    where the 10 is row number as 1 is column number (hence A10).
    A more efficient a safer way of referencing cells is to give them names. So for example in your worksheet you defined cell A10's name to be number then you can use the following code.

    Please Login or Register  to view this content.
    This way if you were to shift cell A10 to some other location on the sheet you will not have to change the code.

    Hope this helps!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1