+ Reply to Thread
Results 1 to 5 of 5

Macro to search column with last value and insert TOTAL column to the left

  1. #1
    Registered User
    Join Date
    06-24-2009
    Location
    boston
    MS-Off Ver
    Excel 2008
    Posts
    3

    Macro to search column with last value and insert TOTAL column to the left

    Hello All-
    I am trying to write a macro that will copy all data from column A of Sheet1, paste/transpose it into row 8of Sheet2, and then add a Total column (with a total formula in row 10) after the last column pasted that has a value. Everytime I run the macro, I will have a different number of values in Column A from Sheet1, so having the Total column added after the last value will be very helpful.

    Can anyone help me with this? I have the copy and paste portion down, I just need help with the searching of the last value in row 8 and inserting a total column to the left of that.

    Thanks in advance for your help!

  2. #2
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Re: Macro to search column with last value and insert TOTAL column to the left

    Do you mean to the left, or to the right of it?

    This line of code will give you the last column:

    Please Login or Register  to view this content.
    If you find the response helpful please click the scales in the blue bar above and rate it
    If you don't like the response, don't bother with the scales, they are not for you

  3. #3
    Registered User
    Join Date
    06-24-2009
    Location
    boston
    MS-Off Ver
    Excel 2008
    Posts
    3

    Re: Macro to search column with last value and insert TOTAL column to the left

    My appologies - I meant that I need to insert a Total column to the RIGHT of the last column.

    Thanks for your help on the first part, it found the last column with data! Now I just need to the macro to insert total into the column to the right.

    Thanks again!

  4. #4
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Re: Macro to search column with last value and insert TOTAL column to the left

    I'm unclear on exactly what the total column is supposed to contain...

    then add a Total column (with a total formula in row 10)
    So the 'Total' has to go in the column after the last one of row 8 that has data, but in row 10. What is it the total of?

  5. #5
    Registered User
    Join Date
    06-24-2009
    Location
    boston
    MS-Off Ver
    Excel 2008
    Posts
    3

    Re: Macro to search column with last value and insert TOTAL column to the left

    To clarify -
    The column headings are in row 8, and I need to insert a TOTAL column to the right of the last column with a heading in row 8.

    The sum formula (that will sume the row from column L to the last column with a heading) will begin in row 10 (row 9 is blank for formatting purposes).

    I hope this helps - sorry I haven't been more clear in what I am attempting to do with this macro.

+ 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