ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Rehide Sheet in macro. (https://www.excelbanter.com/excel-worksheet-functions/80412-rehide-sheet-macro.html)

ChuckF

Rehide Sheet in macro.
 
I have the following macro
Sub testa()
'
' testa Macro
' Macro recorded 3/29/2006 by Chuck F.
'

'
Sheets("Nationals Import Sheet").Visible = True
Sheets("Nationals Import Sheet").Select
Rows("1:1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Columns("A:A").EntireColumn.AutoFit
Cells.Select
Cells.EntireColumn.AutoFit
Range("T2").Select

Basically it unhides a sheet called "Nationals Import Sheet" 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!!


Gazeta

Rehide Sheet in macro.
 

Uzytkownik "ChuckF" napisal w wiadomosci
oups.com...
I have the following macro
Sub testa()
'
' testa Macro
' Macro recorded 3/29/2006 by Chuck F.
'

'
Sheets("Nationals Import Sheet").Visible = True
Sheets("Nationals Import Sheet").Select
Rows("1:1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Columns("A:A").EntireColumn.AutoFit
Cells.Select
Cells.EntireColumn.AutoFit
Range("T2").Select

Basically it unhides a sheet called "Nationals Import Sheet" 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!!

try
workbook("your name").Sheets("Nationals Import Sheet").Visible = false
or
activewindow.activatenext
Sheets("Nationals Import Sheet").Visible = false
mcg



Alan

Rehide Sheet in macro.
 
Try this (untested)
Regards,
Alan.

Sheets("Nationals Import Sheet").Visible = True
Sheets("Nationals Import Sheet").Select
Rows("1:1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Nationals Import Sheet").Visible = False
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Columns("A:A").EntireColumn.AutoFit
Cells.Select
Cells.EntireColumn.AutoFit
Range("T2").Select

"ChuckF" wrote in message
oups.com...
I have the following macro
Sub testa()
'
' testa Macro
' Macro recorded 3/29/2006 by Chuck F.
'

'
Sheets("Nationals Import Sheet").Visible = True
Sheets("Nationals Import Sheet").Select
Rows("1:1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Columns("A:A").EntireColumn.AutoFit
Cells.Select
Cells.EntireColumn.AutoFit
Range("T2").Select

Basically it unhides a sheet called "Nationals Import Sheet" 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!!




ChuckF

Rehide Sheet in macro.
 
Perfect...thanks SO much.



All times are GMT +1. The time now is 02:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com