+ Reply to Thread
Results 1 to 2 of 2

VBA - Input Value If Column Number Equals "x" within Non-Contiguous Named Range

  1. #1
    Registered User
    Join Date
    06-24-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    VBA - Input Value If Column Number Equals "x" within Non-Contiguous Named Range

    Hi all,

    First post as a newbie to VBA and Excel - have found these forums greatly useful in the past and am severely at a loss for how to accomplish the task at hand. Essentially, I want to create a macro that will auto-populate a predefined non-contiguous range of cells with a value that is based on another cell's value. The value that is populated depends on the cell's column number, which corresponds to a user inputted table.

    I've attached a sample worksheet (the yellow cells are the predefined non-contiguous range of cells) - I do need a VBA solution, rather than formulas within the cells, because part of my macro will determine a unique placement of the non-contiguous range.



    I know I can use a named range to address the non-contiguous range of cells in my macro. What I think might work is to identify the column number for each cell within the named range and insert the corresponding value in the user input table (perhaps using offsets?) I just don't know where to start - any help would be greatly appreciated!
    Attached Files Attached Files

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: VBA - Input Value If Column Number Equals "x" within Non-Contiguous Named Range

    greenexcel12345,

    Welcome to the forum. Attached is a modified version of your sample workbook. It contains a button named "Update Table" which is assigned to the following macro:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar
    Attached Files Attached Files

+ 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