+ Reply to Thread
Results 1 to 10 of 10

Adjust code to copy mulitple columns & date stamp

  1. #1
    Registered User
    Join Date
    02-23-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    50

    Adjust code to copy mulitple columns & date stamp

    Hi

    I have the below code which works, however, I'd like to adjust it to:
    1) Copy & paste columns F and H from the "Forecast vs actual" sheet instead of just column F.
    2) Hard code the date stamp so it doesnt change each time I open the document.

    Please Login or Register  to view this content.

    Thanks in advance for your help

    Jen

  2. #2
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Adjust code to copy mulitple columns & date stamp

    Replace 4 lines as below.
    Sub copycolumn1()

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-23-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Adjust code to copy mulitple columns & date stamp

    Thanks for replying!
    I did try inserting F1:H but this also copies over column G as well and I dont need column G, I just need it to copy columns F and H. Any other suggestions?
    The date stamp works perfectly. Thanks
    Jen

  4. #4
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Adjust code to copy mulitple columns & date stamp

    Above code places a date along with time stamp as well. Replace 'Now' to 'Date' if you need only date.

  5. #5
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Adjust code to copy mulitple columns & date stamp

    Quote Originally Posted by tiger01 View Post
    I did try inserting F1:H but this also copies over column G as well and I dont need column G, I just need it to copy columns F and H. Any other suggestions?
    The date stamp works perfectly. Thanks
    Jen
    Oh ok. If G isn hidden and you don't want to copy, you can use SpecialCells property to copy only visible cells.
    Last edited by haripopuri; 02-27-2013 at 11:14 PM.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,613

    Re: Adjust code to copy mulitple columns & date stamp

    Another method...

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Adjust code to copy mulitple columns & date stamp

    To select only visible cells, replace relevant lines with below code.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    02-23-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Adjust code to copy mulitple columns & date stamp

    Sorry column G cant be hidden it needs to be visible. Any further suggestions?
    thanks

  9. #9
    Registered User
    Join Date
    02-23-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Adjust code to copy mulitple columns & date stamp

    Thank You, this works great

  10. #10
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Adjust code to copy mulitple columns & date stamp

    Quote Originally Posted by tiger01 View Post
    Sorry column G cant be hidden it needs to be visible. Any further suggestions?
    thanks
    Please Login or Register  to view this content.

+ 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