ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   copy hidden sheet data (https://www.excelbanter.com/excel-discussion-misc-queries/254616-copy-hidden-sheet-data.html)

Atiq

copy hidden sheet data
 
I have a macro to copy and past data from one sheet to another. It works fine
when I have all the sheets open, but when I hide the source sheet (where my
raw data is stored) macro gives me an error (400). Below is the code:

Sheets("Temp").Select
Range("A1") = "Gas"

Sheets("Nlist").Select
Range("A7").Select
Selection.Copy
Sheets("Temp").Select
Range("A2").Select
ActiveSheet.Paste


I want my raw data sheet
hidden ("Temp" sheet is always visible, and "Nlist" is the one I want to
Hide), what can I do to keep my macro working when raw data sheet is hidden?
Please advise....

Thanks!


Jim Thomlinson

copy hidden sheet data
 
Sheets("Temp").Range("A1") = "Gas"
Sheets("Nlist").Range("A7").Copy Sheets("Temp").Range("A2")

--
HTH...

Jim Thomlinson


"Atiq" wrote:

I have a macro to copy and past data from one sheet to another. It works fine
when I have all the sheets open, but when I hide the source sheet (where my
raw data is stored) macro gives me an error (400). Below is the code:

Sheets("Temp").Select
Range("A1") = "Gas"

Sheets("Nlist").Select
Range("A7").Select
Selection.Copy
Sheets("Temp").Select
Range("A2").Select
ActiveSheet.Paste


I want my raw data sheet
hidden ("Temp" sheet is always visible, and "Nlist" is the one I want to
Hide), what can I do to keep my macro working when raw data sheet is hidden?
Please advise....

Thanks!


Atiq

copy hidden sheet data
 
It works! Thansk!

"Jim Thomlinson" wrote:

Sheets("Temp").Range("A1") = "Gas"
Sheets("Nlist").Range("A7").Copy Sheets("Temp").Range("A2")

--
HTH...

Jim Thomlinson


"Atiq" wrote:

I have a macro to copy and past data from one sheet to another. It works fine
when I have all the sheets open, but when I hide the source sheet (where my
raw data is stored) macro gives me an error (400). Below is the code:

Sheets("Temp").Select
Range("A1") = "Gas"

Sheets("Nlist").Select
Range("A7").Select
Selection.Copy
Sheets("Temp").Select
Range("A2").Select
ActiveSheet.Paste


I want my raw data sheet
hidden ("Temp" sheet is always visible, and "Nlist" is the one I want to
Hide), what can I do to keep my macro working when raw data sheet is hidden?
Please advise....

Thanks!



All times are GMT +1. The time now is 10:32 AM.

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