Results 1 to 4 of 4

Thread: Vba - find next empty column, insert column, copy paste values & copy paste formulas

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2012
    Posts
    7

    Vba - find next empty column, insert column, copy paste values & copy paste formulas

    WINDOWS 7
    EXCEL 2010

    I am creating a report that will be updated monthly then create charts with the newly pulled data. I need to create code that will:
    • Calculate current date, determine previous month's 1st and last dates
    • find last column that contains data
    • copy & paste values of that column (within that same column)
    • find the next available blank column and insert a new column
    • copy the master formula column
    • paste formulas in the newly inserted column
    • calculate
    • Hide any columns older than 6 months.
    Name:  COPY & PASTE SNAP.jpg
Views: 880
Size:  81.1 KB

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Vba - find next empty column, insert column, copy paste values & copy paste formu

    you want someone to do this for you? or you have a question?
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2012
    Posts
    7

    Re: Vba - find next empty column, insert column, copy paste values & copy paste formu

    I'm a novice at VBA and know most of the coding, but putting it together seems to not work. I'm getting stumped.

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Vba - find next empty column, insert column, copy paste values & copy paste formu

    post what you have so far, with details as to what does not work, error, wrong result, nothing

    alternatively post a sample workbook with the code, and details of what the correct results should be

    as i only have an early version of excel i can only open .xls, so saveAs early version, then zip to post
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width