Results 1 to 9 of 9

Using the result of ADDRESS() function as a range for VBA function

Threaded View

  1. #1
    Registered User
    Join Date
    01-08-2016
    Location
    Poland
    MS-Off Ver
    2010, Office 365
    Posts
    14

    Using the result of ADDRESS() function as a range for VBA function

    Hi everybody,

    I'm using the excel ADDRESS() function in a formula like "=ADDRESS(MATCH(B43;$A$1:$A$411;0);1)" and as a result I get the matching cell address, say it's "$A$270".

    Now what I want to do is to use this result as an address for a VBA function, that looks like this:

    Function copycomment()
    
    Range(ActiveCell.Offset(0, -1).Value).Copy
    ActiveCell.PasteSpecial xlPasteComments
    
    End Function
    With the function above I would like to get the value of a cell that is left to the active cell, use it as a range for to copy desired cell and paste only a comment of it to the active cell.

    Using cell range as an argument for a function would make a more universal solution, and I also tried it, but failed. I wanted to use this function like: "=copycomment(C43)", where "C43" is an address of cell with the ADDRESS() function result.

    My problem is generally how to pass the cell value (the result of the ADDRESS() function) as a range for my VBA function.

    Any suggestion will be appreciated!
    Attached Files Attached Files
    Last edited by Szczesiu; 01-11-2016 at 05:52 AM. Reason: Adding an example workbook

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Replacing cell address in a formula with the result of ADDRESS function
    By CMG2 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-25-2014, 02:59 AM
  2. [SOLVED] Using function result as cell address
    By El_engineer in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-19-2013, 08:19 AM
  3. Move to the result of the address function
    By Wigglebritches in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-20-2013, 12:37 AM
  4. [SOLVED] Using the result of a CELL "address" function in another function
    By jphalverson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-21-2013, 11:36 AM
  5. How do you use ADDRESS function result in a macro as a paste destination
    By phanjoe in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-04-2012, 01:10 PM
  6. Convert ADDRESS() function result to literal text
    By ajetrumpet in forum Excel General
    Replies: 6
    Last Post: 03-18-2011, 04:20 PM
  7. Using address function result in an array
    By RLR in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-08-2006, 10:25 PM

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