+ Reply to Thread
Results 1 to 3 of 3

what is wrong with the code

  1. #1
    Registered User
    Join Date
    08-25-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    19

    what is wrong with the code

    I have a worksheet with 50 tabs for each state and recurring data in the similar format in all the tabs.
    data1 data2
    Month1 Temperature Humidity
    Month2 Temperature Humidity
    Month3 Temperature Humidity
    Total Temperature HUmidity
    Month1 Temperature Humidity
    Month2 Temperature Humidity
    Month3 Temperature Humidity
    Total Temperature HUmidity
    Now I need to do 2 things:
    First, I want to copy and paste all the data from each state tab from first workbook to corresponding tabs in another workbook.
    Second, I need to inser t 2 blank rows and a heading row after each total in the copied workbook.
    My code is below:
    Please Login or Register  to view this content.
    The problem with the above code is whenever I run it, it is creating a new worksheet every time and copying data instead of copying data in each state tab in destination workbook and I cannot figure out why it is happening.
    Any suggestion would be much appreciated.
    Thanks,
    Blyzzard

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,155

    Re: what is wrong with the code

    I think it would help others to help you if you uploaded a sample workbook with some typical data so the code can be seen and tested in context.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: what is wrong with the code

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    PLEASE PM WHEN YOU HAVE DONE THIS AND I WILL DELETE THIS POST
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

+ 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