![]() |
macro trouble
hi i have recorded a macro for my workbook to cut paste data however what i
have observed is that the procedure is than some how rough when is pasteing and coming back to the last sheet. may i know how to get it done very smoothly without shaken. here is the code Sub Transfer_() ' ' Transfer_ Macro ' ' Range("Form").Select Selection.Copy Sheets("Sales ").Select Range("Sales[[#Headers],[PRODUCT ID ]]").Select Selection.End(xlDown).Select ActiveCell.Offset(1, 0).Range("Sales[[#Headers],[PRODUCT ID ]]").Select Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _ xlNone, SkipBlanks:=False, Transpose:=False Range("A9").Select Sheets("Form").Select Application.Goto Reference:="TabOrder" Application.CutCopyMode = False Selection.ClearContents Range("D3").Select ActiveCell.FormulaR1C1 = "=t0" Range("D3").Select ActiveCell.FormulaR1C1 = "=TODAY()" Range("B3").Select ActiveWorkbook.Save End Sub |
macro trouble
Hi
Put in Application.Screenupdating = False near the top of the code. It is automatically made true when the sub finishes. regards Paul On Apr 25, 7:46*pm, Amin wrote: hi i have recorded a macro for my workbook to cut paste data however what i have observed is that the procedure is than some how rough when is pasteing and coming back to the last sheet. may i know how to get it done very smoothly without shaken. here is the code Sub Transfer_() ' ' Transfer_ Macro ' ' * * Range("Form").Select * * Selection.Copy * * Sheets("Sales ").Select * * Range("Sales[[#Headers],[PRODUCT ID ]]").Select * * Selection.End(xlDown).Select * * ActiveCell.Offset(1, 0).Range("Sales[[#Headers],[PRODUCT ID ]]").Select * * Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _ * * * * xlNone, SkipBlanks:=False, Transpose:=False * * Range("A9").Select * * Sheets("Form").Select * * Application.Goto Reference:="TabOrder" * * Application.CutCopyMode = False * * Selection.ClearContents * * Range("D3").Select * * ActiveCell.FormulaR1C1 = "=t0" * * Range("D3").Select * * ActiveCell.FormulaR1C1 = "=TODAY()" * * Range("B3").Select * * ActiveWorkbook.Save End Sub |
macro trouble
I'm not sure this is exactly what you had, so try it and post back if it
does not do what you wanted. Sub Transfer_() ' ' Transfer_ Macro ' With Sheets("Form") .Range("Form").Copy With Sheets("Sales ") .Range("Sales[[#Headers],[PRODUCT ID ]]").PasteSpecial _ Paste:=xlPasteValuesAndNumberFormats, Operation:= _ xlNone, SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False End With .Range("TabOrder").ClearContents .Range("D3").FormulaR1C1 = "=t0" .Range("D3").FormulaR1C1 = "=TODAY()" End With ActiveWorkbook.Save End Sub I might have guessed wrong on the named ranges. "Paul Robinson" wrote in message ... Hi Put in Application.Screenupdating = False near the top of the code. It is automatically made true when the sub finishes. regards Paul On Apr 25, 7:46 pm, Amin wrote: hi i have recorded a macro for my workbook to cut paste data however what i have observed is that the procedure is than some how rough when is pasteing and coming back to the last sheet. may i know how to get it done very smoothly without shaken. here is the code Sub Transfer_() ' ' Transfer_ Macro ' ' Range("Form").Select Selection.Copy Sheets("Sales ").Select Range("Sales[[#Headers],[PRODUCT ID ]]").Select Selection.End(xlDown).Select ActiveCell.Offset(1, 0).Range("Sales[[#Headers],[PRODUCT ID ]]").Select Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _ xlNone, SkipBlanks:=False, Transpose:=False Range("A9").Select Sheets("Form").Select Application.Goto Reference:="TabOrder" Application.CutCopyMode = False Selection.ClearContents Range("D3").Select ActiveCell.FormulaR1C1 = "=t0" Range("D3").Select ActiveCell.FormulaR1C1 = "=TODAY()" Range("B3").Select ActiveWorkbook.Save End Sub |
All times are GMT +1. The time now is 08:45 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com