+ Reply to Thread
Results 1 to 8 of 8

copy and pasting in hidden sheets

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,176

    copy and pasting in hidden sheets

    I have a spreadsheet with multiple sheets and two of these sheets I need to hide (sheet1 and sheet2). I have a macro that copies data from sheet1 to sheet2. If I hide the sheets, I get a runtime error. How can I simplify my code so I don't have to include in my code commands to unhide and hide my sheets? Thanks


    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    You don't need to select anything which should get round your problem:
    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717
    Here is the code which copies the column A data from sheet1 to sheet2...

    Please Login or Register  to view this content.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Just define the range & copy it to the destination sheet, no need for a loop.

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,176
    Thanks for the code. One more question. I just realized that when I do the paste, I am using a paste special and pasting values only. How do incorporate this into the new code?


    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    In my code:
    Please Login or Register  to view this content.
    Similar for Roy's code.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Maybe

    Please Login or Register  to view this content.

  8. #8
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Extrapolating from Roy's thought, this should work too:
    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)

Similar Threads

  1. Copy & Pasting Conditional Formats (Excel 07)
    By flib in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-15-2008, 04:12 PM
  2. Copy sheets and remove named range
    By digdug in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2007, 04:41 AM
  3. Pasting into password protected sheets.
    By adotsey in forum Excel General
    Replies: 1
    Last Post: 04-24-2007, 03:02 PM
  4. copy and pasting formulas!!
    By shwiger in forum Excel General
    Replies: 2
    Last Post: 04-22-2007, 07:55 PM
  5. help with copy sheets of data
    By CC_mfc in forum Excel General
    Replies: 3
    Last Post: 02-09-2007, 03:38 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