+ Reply to Thread
Results 1 to 7 of 7

Macro to complete table of data

  1. #1
    Registered User
    Join Date
    06-26-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    11

    Macro to complete table of data

    Hi,

    I am trying to write a macro that enters the value 0 (zero) in the cells across a row from Column F to the last used column in the row above. The last used column will move from month to month, so I need this to be able to capture this variable.

    Can anyone assist me in doing this?

    To simplify, rows 1 to 10 have data from Column A to M, but there is data needing to be added down to row 15. I am needing to enter zeros from column F to (in this case) M for rows 11 to 15. How can I write a macro that populates the cells from F11:M15 with zeros, but can change the row and column as the data is altered?

    Thanks in advance for your help.
    Robbie
    Last edited by RobbieMoulton; 06-29-2011 at 11:04 PM.

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro to complete table of data

    Please Login or Register  to view this content.



  3. #3
    Registered User
    Join Date
    06-26-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Macro to complete table of data

    Thanks. This seems to enter the value in one cell, rather than them all. And if I loop it, it doesn't move down the rows or recognise where the last column is.

    Is there someway to have the macro fill all the cells in the row to the right, up to where the final column is in the row above?
    Thanks

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro to complete table of data

    I hoped you were able to find out yourself, given he frist step I gave.

  5. #5
    Registered User
    Join Date
    06-26-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Macro to complete table of data

    No, sorry - I know how to put the value in one cell.

    My issue was about having the macro recognise where the first cell is, enter the value across the row until it reaches the end (based off the above row), before continuing the process down the rows until it recognises the end of the data.

    Thanks

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro to complete table of data

    Look into VBEditor's help files. Look for 'resize'.

  7. #7
    Registered User
    Join Date
    06-26-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Macro to complete table of data

    I'm not sure where/what VBEditor is?

    Can anyone else help me with this query?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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