+ Reply to Thread
Results 1 to 10 of 10

How to Add New Worksheet named "Report" and run loop through all the Sheets Except "Report

  1. #1
    Forum Contributor
    Join Date
    06-20-2012
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    359

    How to Add New Worksheet named "Report" and run loop through all the Sheets Except "Report

    Hello,

    I am keenly looking to learn few things and tweak the below macro.

    1. How to add new worksheet "Report"? If it already exist then do nothing

    2. How to Loop through all the Sheets Except the Sheet "Report"

    3. Suggest any other tweaks If I missed to learn

    "For i = 1 To Sheets.Count - 1" This line seems to be incorrect. If I Move the "Report" Sheet from Last to First then The macro becomes messy.

    Please Login or Register  to view this content.
    Thank you.

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,913

    Re: How to Add New Worksheet named "Report" and run loop through all the Sheets Except "Re

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    06-20-2012
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    359

    Re: How to Add New Worksheet named "Report" and run loop through all the Sheets Except "Re

    Thank you very much

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,913

    Re: How to Add New Worksheet named "Report" and run loop through all the Sheets Except "Re

    You're welcome and thanks for the rep.

  5. #5
    Forum Contributor
    Join Date
    06-20-2012
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    359

    Re: How to Add New Worksheet named "Report" and run loop through all the Sheets Except "Re

    Hello,

    How to modify the code If I don't know the Exact ranges to be copied in Each Sheet? or If the Data in Each Sheet is Dynamic? Can I Use the Property CurrentRegion? Or UsedRange?

    Thank you

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,913

    Re: How to Add New Worksheet named "Report" and run loop through all the Sheets Except "Re

    Please post example file of how a sheet looks like (desensitize data if needed)
    It's always data in column A that needs to copied no matter the length of data ?

  7. #7
    Forum Contributor
    Join Date
    06-20-2012
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    359

    Re: How to Add New Worksheet named "Report" and run loop through all the Sheets Except "Re

    No.It's not always Data in Column A that needs to be copied. But, the Starting cell is always "A2"

    What I mean to say is for Example

    Sheet1 - Data is in Range ("A2:C5") dynamic range which may change next day to ("A2:G25")
    Sheet2 - Data is in Range ("A2:F16") dynamic range too
    Sheet3 - Data is in Range ("A2:L25") same

    and So on

    So, If the data in Each sheet is Dynamic then how do I copy the Entire Data from all the Sheets(1,2,3,4,5, etc.,) to the Sheet named "Report". I want to Identify the Dynamic Range in Each Sheet and copy the same to "Report" Sheet.

    The Below line is copying only Ten Cells In Column"A"

    Please Login or Register  to view this content.
    Thank you

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,913

    Re: How to Add New Worksheet named "Report" and run loop through all the Sheets Except "Re

    Try this. I assume you have headers in Row 1 ?
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    06-20-2012
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    359

    Re: How to Add New Worksheet named "Report" and run loop through all the Sheets Except "Re

    Thank you Sir.

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,913

    Re: How to Add New Worksheet named "Report" and run loop through all the Sheets Except "Re

    No probs.

+ 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. Display "(Multiple Items)" in the Pivot Table's Report Filter
    By ljhyun89s in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 07-11-2017, 09:43 AM
  2. Replies: 5
    Last Post: 12-27-2016, 04:24 PM
  3. Replies: 5
    Last Post: 05-07-2016, 02:16 PM
  4. Replies: 10
    Last Post: 12-31-2014, 11:04 AM
  5. VBA change pivot "report filter" from userform textbox or combobox
    By mmor79 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-11-2014, 12:57 PM
  6. Replies: 2
    Last Post: 06-06-2013, 12:45 PM
  7. Filter report in pivot table with "greater than" and "less than"
    By gygabyte017 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 12-29-2012, 08:08 AM

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