Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Ok, there should be 3 panes here, the one on the top left should have
a folder titled: "Modules". Right click and select "Insert"--- Module. Now the pane on the right should be completely blank, (the big one). Copy the following code and paste it into this pane. -----------------------------------------------Start Copying Just Below This Line----------------------------------------- Sub CustomPaste() Dim CopySheet As Worksheet Dim PasteSheet As Worksheet Dim CurRng As Range Dim CopyRng As Range 'Not used, future improvement Dim PasteRng As Range 'Not used, future improvement On Error GoTo ErrCustomPaste 'Hold the currently selected cell to return to at end of routine Set CurRng = Application.ActiveCell 'Hold the values of the sheets to be used in variables (improve performance) Set CopySheet = Sheets("Sheet1") Set PasteSheet = Sheets("Sheet2") 'Freeze the screen to improve performance Application.ScreenUpdating = False 'Copy and Paste the information With CopySheet .Select .Range("A1:A2").Copy PasteSheet.Range("B1:B2") End With With CopySheet .Select .Range("A3:A4").Copy PasteSheet.Range("C10:C11") End With With CopySheet .Select .Range("A5:A6").Copy PasteSheet.Range("D1:D2") End With 'Return to the originally selected cell CurRng.Select 'Refresh the screen to update changes Application.ScreenUpdating = True Exit Sub ErrCustomPaste: MsgBox "An unknown error ocurred within the CustomPaste procedure.", vbExclamation, _ "Custom Paste Abort!" CurRng.Select Application.ScreenUpdating = True End Sub -----------------------------------------------Stop Copying Just Above This Line----------------------------------------- Save your workbook now! Now go back to the Excel Window and select: Tools...Macro---Macros There should be a window that appears with an option to run "CustomPaste" Select it and click Run If you cannot, then more than likely, we will have to change your Macro Security Settings before we continue... Lemme know how it goes... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I transfer a required data from sheet 1 to sheet 2 automat | Excel Discussion (Misc queries) | |||
how to transfer data from sheet to sheet with new range? | Excel Discussion (Misc queries) | |||
How to transfer text to an sheet if the cells en range contains a | Excel Discussion (Misc queries) | |||
How to Automatically transfer specific Data from Sheet 1 to Sheet | Excel Worksheet Functions | |||
Transfer/Copy Sheet, Dynamically linked Sheet | Excel Discussion (Misc queries) |