I have the following macro
Sub testa()
'
' testa Macro
' Macro recorded 3/29/2006 by Chuck F.
'
'
Sheets(quot;Nationals Import Sheetquot;).Visible = True
Sheets(quot;Nationals Import Sheetquot;).Select
Rows(quot;1:1quot;).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Columns(quot;A:Aquot;).EntireColumn.AutoFit
Cells.Select
Cells.EntireColumn.AutoFit
Range(quot;T2quot;).Select
Basically it unhides a sheet called quot;Nationals Import Sheetquot; and copies
the data into a new workbook.
What I can't figure out is how to have the macro go back into the
orgional sheet, and rehide that tab.
Any help would be great!!
Uzytkownik quot;ChuckFquot; gt; napisal w wiadomosci oups.com...
gt; I have the following macro
gt; Sub testa()
gt; '
gt; ' testa Macro
gt; ' Macro recorded 3/29/2006 by Chuck F.
gt; '
gt;
gt; '
gt; Sheets(quot;Nationals Import Sheetquot;).Visible = True
gt; Sheets(quot;Nationals Import Sheetquot;).Select
gt; Rows(quot;1:1quot;).Select
gt; Range(Selection, Selection.End(xlDown)).Select
gt; Selection.Copy
gt; Workbooks.Add
gt; Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
gt; SkipBlanks _
gt; :=False, Transpose:=False
gt; Columns(quot;A:Aquot;).EntireColumn.AutoFit
gt; Cells.Select
gt; Cells.EntireColumn.AutoFit
gt; Range(quot;T2quot;).Select
gt;
gt; Basically it unhides a sheet called quot;Nationals Import Sheetquot; and copies
gt; the data into a new workbook.
gt;
gt; What I can't figure out is how to have the macro go back into the
gt; orgional sheet, and rehide that tab.
gt;
gt; Any help would be great!!
gt;
try
workbook(quot;your namequot;).Sheets(quot;Nationals Import Sheetquot;).Visible = false
or
activewindow.activatenext
Sheets(quot;Nationals Import Sheetquot;).Visible = false
mcg
Try this (untested)
Regards,
Alan.
Sheets(quot;Nationals Import Sheetquot;).Visible = True
Sheets(quot;Nationals Import Sheetquot;).Select
Rows(quot;1:1quot;).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets(quot;Nationals Import Sheetquot;).Visible = False
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Columns(quot;A:Aquot;).EntireColumn.AutoFit
Cells.Select
Cells.EntireColumn.AutoFit
Range(quot;T2quot;).Select
quot;ChuckFquot; gt; wrote in message oups.com...
gt;I have the following macro
gt; Sub testa()
gt; '
gt; ' testa Macro
gt; ' Macro recorded 3/29/2006 by Chuck F.
gt; '
gt;
gt; '
gt; Sheets(quot;Nationals Import Sheetquot;).Visible = True
gt; Sheets(quot;Nationals Import Sheetquot;).Select
gt; Rows(quot;1:1quot;).Select
gt; Range(Selection, Selection.End(xlDown)).Select
gt; Selection.Copy
gt; Workbooks.Add
gt; Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
gt; SkipBlanks _
gt; :=False, Transpose:=False
gt; Columns(quot;A:Aquot;).EntireColumn.AutoFit
gt; Cells.Select
gt; Cells.EntireColumn.AutoFit
gt; Range(quot;T2quot;).Select
gt;
gt; Basically it unhides a sheet called quot;Nationals Import Sheetquot; and copies
gt; the data into a new workbook.
gt;
gt; What I can't figure out is how to have the macro go back into the
gt; orgional sheet, and rehide that tab.
gt;
gt; Any help would be great!!
gt;
Perfect...thanks SO much.
- Jul 20 Thu 2006 20:08
Rehide Sheet in macro.
close
全站熱搜
留言列表
發表留言