+ Reply to Thread
Results 1 to 4 of 4

worksheet change event to populate formula for number of columns

  1. #1
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    worksheet change event to populate formula for number of columns

    Hi all,

    in the attached workbook I am trying to populate a range with data to record depreciation over time. I would like to automate the population by an change event in column "k" (k will dictate the start column number). Either by a formula in all cells in range that reacts when "k" >"" or a macro that copies the formula to a number of columns dictated by column h and a formula between "h" and "e".

    Basically column "k" will be the start column number, the number of columns populated will be dictated by the "h" column(duration of write down) and the value will be decreased accordingly.

    Not easy explain but straightforward enough. I tried to do a hlookup to try to identify the start column and use an offset to populate the number of columns but I couldn't get a handle on hlookup as never used before. Any pointers appreciated.

    Rgds
    Attached Files Attached Files
    Last edited by nigelog; 11-16-2017 at 10:29 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: worksheet change event to populate formula for number of columns

    Your Hlookup() is a bit out.

    Please Login or Register  to view this content.

  3. #3
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: worksheet change event to populate formula for number of columns

    Hi Dave, that was a first attempt to try to identify the correct column
    this returns the value of the required first column in row1
    Please Login or Register  to view this content.
    but I would like to copy a formula
    Please Login or Register  to view this content.
    from that column up to the number of columns dictated by
    Please Login or Register  to view this content.
    which would be a offset to the row in question, in this instance "6"

    columns j and k should not be necessary as the start month should be dictated by the date in column f and a hlookup of the dates in row 4,
    with
    Please Login or Register  to view this content.
    but i thought it easier to start with the simple extracted value and put it all into one later
    Last edited by nigelog; 11-16-2017 at 10:10 AM.

  4. #4
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: worksheet change event to populate formula for number of columns

    Does hlookup only return a value though or can it be used to identify a start point??

    this works without the helper column but has a problem passing the change of year
    Please Login or Register  to view this content.
    so thats really what I need in the columns from start date to number of columns
    Last edited by nigelog; 11-16-2017 at 10:27 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Worksheet Change Event Is very Slow To work copy formula and paste
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-07-2017, 07:12 AM
  2. [SOLVED] Using worksheet change event to monitor certain columns for changes
    By jprlimey in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-22-2017, 07:18 AM
  3. [SOLVED] Worksheet change event with any number of cells
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-11-2016, 03:07 PM
  4. Hide Columns based on Date value in cell (Worksheet Change event)
    By jstriker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-22-2014, 04:37 PM
  5. How to use event change to populate two cells
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 04-18-2012, 10:24 AM
  6. Worksheet Change Event not triggering with cells containing formula
    By Skell in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-15-2012, 06:16 PM
  7. Replies: 5
    Last Post: 06-23-2005, 06:05 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