Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For other novices like me, I was able to dig out the answer myself. this code
gets me back to the sheet I came from. Dim homesheet As Worksheet Set homesheet = ActiveSheet 'gets the name Sheets("different sheet").Select 'code to do your thing on this sheet homesheet.Activate 'get you back to from where you came. "Neal Zimm" wrote: Hi - Am novice in VB. this is part of a macro I recorded to copy a range of cells. I was working in the temp worksheet, and the sheets temp select statement was based on my clicking. I'd like to generalize this section to copy the 'blank pg' cells from any worksheet. User would highlight cells on his current worksheet and execute the macro to copy back to his sheet. How do I find out the name of the sheet from whence I came? Code would be appreciated. The Go To dialog box did not give me this last location. How does something get into the Go To dialog box? Sheets("blank pg").Select ActiveCell.Range("A1:H20").Select Selection.Copy Sheets("temp").Select Selection.Insert Shift:=xlDown ActiveSheet.Paste Application.CutCopyMode = False Thanks much. Neal Z |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet | Excel Programming | |||
How to end macro on inital active worksheet containing macro button that was clicked | Excel Programming | |||
How? Macro to copy range to new worksheet, name new worksheet, loop | Excel Programming | |||
macro to apply worksheet event to active worksheet | Excel Programming | |||
Record Worksheet Content as Macro and Execute from another Worksheet | Excel Programming |