Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Jon Jon is offline
external usenet poster
 
Posts: 183
Default How to transfer a range from sheet to sheet?

Greeting,

Is there any way to transfer the range e.g. a1:a6 from sheet1 to sheet2 but
in sheet2 should be distributed as follows:

From a1:a2 to sheet 2 b1:b2

From a3:a4 to sheet 2 c10:c11

From a5:a6 to sheet 2 d1:d2

Any help please to do it in one go???

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 102
Default How to transfer a range from sheet to sheet?

Do you know how to use macros and or VBA?

  #3   Report Post  
Posted to microsoft.public.excel.misc
Jon Jon is offline
external usenet poster
 
Posts: 183
Default How to transfer a range from sheet to sheet?

No, Please advice??

"Mark" wrote:

Do you know how to use macros and or VBA?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 102
Default How to transfer a range from sheet to sheet?

Ok, here goes:

1) "RightClick" the Excel menu bar at the top of your screen: A
dropdown menu should appear that offers an option for "Visual Basic".
Click on it and a new bar should appear on your screen.
On this bar there should be an icon that looks like a page with
some sort of red and yellow on top of it. Click on this. You should
now have a new window open to the Visual Basic Editor.

Try this and then let me know if you got this far, then we will
continue.


  #5   Report Post  
Posted to microsoft.public.excel.misc
Jon Jon is offline
external usenet poster
 
Posts: 183
Default How to transfer a range from sheet to sheet?

Thank you, So far so good, please go ahead

"Mark" wrote:

Ok, here goes:

1) "RightClick" the Excel menu bar at the top of your screen: A
dropdown menu should appear that offers an option for "Visual Basic".
Click on it and a new bar should appear on your screen.
On this bar there should be an icon that looks like a page with
some sort of red and yellow on top of it. Click on this. You should
now have a new window open to the Visual Basic Editor.

Try this and then let me know if you got this far, then we will
continue.





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 102
Default How to transfer a range from sheet to sheet?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I transfer a required data from sheet 1 to sheet 2 automat Malik Nadeem Excel Discussion (Misc queries) 6 October 24th 07 11:48 AM
how to transfer data from sheet to sheet with new range? Jon Excel Discussion (Misc queries) 6 August 20th 07 06:36 PM
How to transfer text to an sheet if the cells en range contains a mia_kit Excel Discussion (Misc queries) 2 May 24th 07 04:40 PM
How to Automatically transfer specific Data from Sheet 1 to Sheet Jman Excel Worksheet Functions 12 May 10th 07 05:35 AM
Transfer/Copy Sheet, Dynamically linked Sheet 0-0 Wai Wai ^-^ Excel Discussion (Misc queries) 2 December 23rd 05 10:04 PM


All times are GMT +1. The time now is 09:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"