Loading
Ozgrid Excel Help & Best Practices Forums

Excel Training / Excel Dashboards Reports



Results 1 to 4 of 4

Thread: Reference Cell In Macro Using Row & Column Numbers From Cell

  1. #1
    Join Date
    30th July 2008
    Posts
    8

    Reference Cell In Macro Using Row & Column Numbers From Cell

    I can't seem to think straight on this one...

    I'm trying to reference a location on a spreadsheet in a macro by using the values in two cells (the idea is to then paste to this location):

    D2 is 17 (the row)
    B4 is 2 (the column)

    therefore the location is B17 (R17C2), but can I get this to work...? The values in these cells can change depending on selections made which is why I want to use the cell references rather than the absolute!

    Any help would be appreciated.
    Thanks, Pete

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    11th December 2007
    Posts
    36

    Re: Referencing A Location From Two Cell Values

    I'm not quite sure I understand, but
    VB:
    cells(row,column) 
    
    
    returns a range with coordinates row (as a number) and column (as a number).

    Excel Video Tutorials / Excel Dashboards Reports


  3. #3
    Join Date
    18th November 2004
    Location
    God's Own Country
    Posts
    4,678

    Re: Referencing A Location From Two Cell Values

    Hi,

    VB:
    Dim r   As Long, c  As Long 
    r = Range("D2") 
    c = Range("B4") 
    MsgBox Cells(r, c) 
    
    

  4. #4
    Join Date
    30th July 2008
    Posts
    8

    Re: Referencing A Location From Two Cell Values

    Thanks Kris & Great Big Bear - problem solved thanks to you guys!

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

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

Possible Answers

  1. Reference Last Cell In Column
    By clord in forum Excel General
    Replies: 3
    Last Post: February 28th, 2013, 12:16
  2. Reference Row & Column Of Cell
    By phaley in forum Excel General
    Replies: 2
    Last Post: January 8th, 2008, 11:37
  3. Reference Cell After Last In Column
    By doyleday in forum Excel General
    Replies: 2
    Last Post: July 19th, 2007, 01:37
  4. Replies: 1
    Last Post: October 9th, 2006, 09:11
  5. Cell reference - in the same column
    By thiagarr in forum Excel General
    Replies: 2
    Last Post: November 16th, 2005, 09:05

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
  •  
porno