Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Stop selecting the other worksheet.
Option Explicit Sub Macro2() with workSheets("Summary") .Range("A38:C51").Copy .Range("E38").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False .range("g38").currentregion.sort Key1:=.Range("G38"), _ Order1:=xlDescending, Header:=xlNo, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal end with End Sub I sorted .currentregion. I'm not sure if that's what you wanted. enyaw wrote: Sub Macro2() ' ' Macro2 Macro ' Macro recorded 23/01/2007 by GX ' Sheets("Summary").Select Range("A38:C51").Select Selection.Copy Range("E38").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False Selection.sort Key1:=Range("G38"), Order1:=xlDescending, Header:=xlNo, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End Sub This is my code that is run when changes are made to a sheet. I have a sheet for each day of the month and a summary sheet at the end of the month. When the values are entered into to the days sheets it goes into the summary sheet and this macro runs. The problem is i want the macro to run when the info is entered but i also want to stay on the sheet i am on. Can anyone help? -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to return to original cell | Excel Discussion (Misc queries) | |||
return to original sheet | Excel Programming | |||
Return to Original Workbook | Excel Programming | |||
Return WB to original state | Excel Programming | |||
Return to Original File | Excel Programming |