Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
hide sheet
hi,
i have some programming in sheet1 like: range("A1").select selection.copy range("C1").select selection.paste right now the code only works if i make the code go to the sheet firt like: sheets("sheet1").select i would like to know how i can stay on my current sheet_new and have the code execute without having to actually go to or put focus on sheet1 as made possible by the sheets("sheet1").select thanks in advance, geebee |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
hide sheet
Sub foo()
With Sheets("Sheet1") .Range("A1").Copy .Range("C1").PasteSpecial xlPasteAll End With Application.CutCopyMode = False End Sub geebee noSPAMs wrote: hi, i have some programming in sheet1 like: range("A1").select selection.copy range("C1").select selection.paste right now the code only works if i make the code go to the sheet firt like: sheets("sheet1").select i would like to know how i can stay on my current sheet_new and have the code execute without having to actually go to or put focus on sheet1 as made possible by the sheets("sheet1").select thanks in advance, geebee |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
hide sheet
hi,
with the code you have, it assumes that your are talking about the current sheet. to do something on another sheet, you have to specify which sheets. Sub copyit() Activeworkbook.sheets("sheet1").select ActiveWorkbook.Sheets("sheet2").Range("A1").Copy ActiveWorkbook.Sheets("sheet2").Range("A2").PasteS pecial xlPasteAll End Sub regards FSt1 "geebee" wrote: hi, i have some programming in sheet1 like: range("A1").select selection.copy range("C1").select selection.paste right now the code only works if i make the code go to the sheet firt like: sheets("sheet1").select i would like to know how i can stay on my current sheet_new and have the code execute without having to actually go to or put focus on sheet1 as made possible by the sheets("sheet1").select thanks in advance, geebee |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
hide sheet
You can do it with one command:
with worksheets("Sheet1") .range("A1").Copy .Range("C1") End With -- Regards, Tom Ogilvy "geebee" wrote: hi, i have some programming in sheet1 like: range("A1").select selection.copy range("C1").select selection.paste right now the code only works if i make the code go to the sheet firt like: sheets("sheet1").select i would like to know how i can stay on my current sheet_new and have the code execute without having to actually go to or put focus on sheet1 as made possible by the sheets("sheet1").select thanks in advance, geebee |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
hide sheet
this is a good way to avoind the sheet apearing during a copy operation, but
what about an operation like programatically hiding a pivot table value? "Tom Ogilvy" wrote: You can do it with one command: with worksheets("Sheet1") .range("A1").Copy .Range("C1") End With -- Regards, Tom Ogilvy "geebee" wrote: hi, i have some programming in sheet1 like: range("A1").select selection.copy range("C1").select selection.paste right now the code only works if i make the code go to the sheet firt like: sheets("sheet1").select i would like to know how i can stay on my current sheet_new and have the code execute without having to actually go to or put focus on sheet1 as made possible by the sheets("sheet1").select thanks in advance, geebee |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Create Sheet, Hide Sheet | Excel Discussion (Misc queries) | |||
hide sheet name/ Tab | New Users to Excel | |||
hide sheet | Excel Discussion (Misc queries) | |||
Hide a sheet | Excel Discussion (Misc queries) | |||
hide sheet? uncheck sheet tabs? or ??? | Excel Programming |