sht.name

  1. M

    Clearing multiple sheets VBA

    Hi The code below works with only one condition in the IF statement (the first one - Summary sheet). However, when I add the other two sheet names that should NOT be cleared, it doesn't work? Do I need to change something in the IF statement? Thanks in advance. Code that works: Sub...
  2. G

    Having Trouble with Deleteing Sheets

    For Each sht In ActiveWorkbook.Worksheets If sht.Visible And sht.Name = ("ASY") And sht.Name = ("TEMP") Then sht.Delete Worksheets.Add().Name = "ASY" Worksheets.Add().Name = "TEMP" Sheets("ASY").Move After:=Sheets("DATA") Sheets("TEMP").Move After:=Sheets("ASY")...
  3. G

    Delete Specific Sheets in a Workbook

    For Each sht In ActiveWorkbook.Worksheets If sht.Visible And (sht.Name = "4-0") _ And (sht.Name = "4-1") _ And (sht.Name = "4-2") Then sht.Delete End If Next sht Hello all I thought the code above would loop through the workbook and delete the specific sheets listed...
  4. G

    Horizontal / Vertical Alignment not Working

    For Each sht In ActiveWorkbook.Worksheets If (sht.Name = "Recovery") And (sht.Name = "Revisions") Then sht.Activate With Range("A7:AV3000") .Clear .NumberFormat = "General" .Interior.Pattern = xlNone Range("B6") = "Document Number"...
  5. G

    SynTax Issues for Clearing a Specific Sheet

    Sub Clear_Eng_1() Dim sht As Worksheets For Each sht In ActiveWorkbook.Worksheets If (sht.Name <> "ECD") And (sht.Name <> "Revisions") Then sht.Activate With Range("A7:AV3000") .Clear .NumberFormat = "General" .Interior.Pattern = xlNone...
  6. A

    VBA Code to exclude sheets with no data

    Hi I have this formula below (thanks Rick Rothstein!) that combines all worksheet data in to one worksheet. However, I need to exclude those worksheets/tab with no data at all (only with header). PLEASE HELP ME! THANK YOU!!! Sub Button2_Click() Dim NextRow As Long, Sht As Worksheet For...
  7. A

    VBA code to copy all data not only one row data

    Hi, pls help. I am combining all worksheets data into one worksheet. Below is the code. However, it's only copying the second row data (below header). How can I copy all? Thanks! Sub Button2_Click() Dim Sht As Worksheet For Each Sht In ActiveWorkbook.Worksheets If Sht.Name <> "READ ME" And...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top