Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bee Bee is offline
external usenet poster
 
Posts: 46
Default Copying Sheet1 to Sheet2 in a certain pattern

I have 2 Worksheets Sheet1 and Sheet2.

Sheet2 contains the raw data and Sheet1 is the raw data arranged in specific
requirement.

I have all this formula =IF('Sheet2'!A1="","",'Sheet2'!A1) on every cells
from A1 to D50000

I am copying Sheet2 Cells A1,A2,A3,B1,B2,B3 to Sheet1

A1 is Name1
A2 is Date/Time
A3 is Name2
B1 is Value1
B2 is Value2
B3 is Result.

Copy to Sheet1
A1 is Sheet2.Name1
A2 is Sheet2.Value1
A3 is Sheet2.Value2
A4 is Sheet2.Date/Time

What I did is manually key in the formula in every cells on Sheet1.

May I know how can i do it using a marco.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Copying Sheet1 to Sheet2 in a certain pattern

BEE
What you say is not clear. You say that you have that formula in each
of 50000 cells. Why? Do you want Sheet1 to display every one of those
50000 cells from Sheet2? You say you are copying 6 cells and you give the
addresses of those 6 cells in Sheet2. But then you give only 4 destination
cells in Sheet1. What happened to the other two cell values?
You say that you want to copy the data "arranged in specific requirement."
Is there a pattern to what you want that repeats? If so, provide specific
cell addresses that you want copied to specific cell addresses for at least
2 repeats of the pattern. HTH Otto

"BEE" wrote in message
...
I have 2 Worksheets Sheet1 and Sheet2.

Sheet2 contains the raw data and Sheet1 is the raw data arranged in
specific
requirement.

I have all this formula =IF('Sheet2'!A1="","",'Sheet2'!A1) on every cells
from A1 to D50000

I am copying Sheet2 Cells A1,A2,A3,B1,B2,B3 to Sheet1

A1 is Name1
A2 is Date/Time
A3 is Name2
B1 is Value1
B2 is Value2
B3 is Result.

Copy to Sheet1
A1 is Sheet2.Name1
A2 is Sheet2.Value1
A3 is Sheet2.Value2
A4 is Sheet2.Date/Time

What I did is manually key in the formula in every cells on Sheet1.

May I know how can i do it using a marco.



  #3   Report Post  
Posted to microsoft.public.excel.programming
Bee Bee is offline
external usenet poster
 
Posts: 46
Default Copying Sheet1 to Sheet2 in a certain pattern

What you say is not clear.
Sorry for the confusion.


You say that you have that formula in each of 50000 cells. Why? Do you
want Sheet1 to display every one of those 50000 cells from Sheet2?
Yes. Basically is all data of sheet2 to sheet1 in a specific arrangement.


You say you are copying 6 cells and you give the addresses of those 6 cells
in Sheet2. But then you give only 4 destination cells in Sheet1. What
happened to the other two cell values?
Forgot to state.


You say that you want to copy the data "arranged in specific requirement."
Is there a pattern to what you want that repeats? If so, provide specific
cell addresses that you want copied to specific cell addresses for at least
2 repeats of the pattern

Sheet2
A1(Name1) B1(Date/Time) C1(Name2)
A2(Value1)B2(Value2) C2(Result)
A3(Name1) B3(Date/Time) C3(Name2)
A4(Value1)B4(Value2) C4(Result)

Sheet1
A1(Name1)A2(Value1)B2(Value2)B1(Date/Time)C1(Name2)C2(Result)
A3(Name1)A4(Value1)B4(Value2)B3(Date/Time)C3(Name2)C4(Result)
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Copying Sheet1 to Sheet2 in a certain pattern

BEE
This little macro should work for you. I named the source sheet "Source"
and the destination sheet "Destination". Note that both sheet names are in
the macro. Change these names as needed. HTH Otto
Sub ReArrange()
Dim rColA As Range
Dim ACell As Range
Dim Dest As Range
Sheets("Source").Select
Set ACell = Range("A1")
Set Dest = Sheets("Destination").Range("A1")
Do
ACell.Copy Dest
ACell.Offset(1).Copy Dest.Offset(, 1)
ACell.Offset(1, 1).Copy Dest.Offset(, 2)
ACell.Offset(, 1).Copy Dest.Offset(, 3)
ACell.Offset(, 2).Copy Dest.Offset(, 4)
ACell.Offset(1, 2).Copy Dest.Offset(, 5)
Set Dest = Dest.Offset(1)
Set ACell = ACell.Offset(2)
Loop Until IsEmpty(ACell.Value)
End Sub
"BEE" wrote in message
...
What you say is not clear.
Sorry for the confusion.


You say that you have that formula in each of 50000 cells. Why? Do you
want Sheet1 to display every one of those 50000 cells from Sheet2?
Yes. Basically is all data of sheet2 to sheet1 in a specific arrangement.


You say you are copying 6 cells and you give the addresses of those 6
cells
in Sheet2. But then you give only 4 destination cells in Sheet1. What
happened to the other two cell values?
Forgot to state.


You say that you want to copy the data "arranged in specific requirement."
Is there a pattern to what you want that repeats? If so, provide specific
cell addresses that you want copied to specific cell addresses for at
least
2 repeats of the pattern

Sheet2
A1(Name1) B1(Date/Time) C1(Name2)
A2(Value1)B2(Value2) C2(Result)
A3(Name1) B3(Date/Time) C3(Name2)
A4(Value1)B4(Value2) C4(Result)

Sheet1
A1(Name1)A2(Value1)B2(Value2)B1(Date/Time)C1(Name2)C2(Result)
A3(Name1)A4(Value1)B4(Value2)B3(Date/Time)C3(Name2)C4(Result)



  #5   Report Post  
Posted to microsoft.public.excel.programming
Bee Bee is offline
external usenet poster
 
Posts: 46
Default Copying Sheet1 to Sheet2 in a certain pattern

I have tried the code and the PC hangs that I need to restart the PC.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Copying Sheet1 to Sheet2 in a certain pattern

BEE
It works for me. Where did you put the macro (what module)? What
version of Excel are you using (I have 2002)? What is your macro security
setting (Tools - Macro - Macro Security)? HTH Otto
"BEE" wrote in message
...
I have tried the code and the PC hangs that I need to restart the PC.



  #7   Report Post  
Posted to microsoft.public.excel.programming
Bee Bee is offline
external usenet poster
 
Posts: 46
Default Copying Sheet1 to Sheet2 in a certain pattern

Thank you for your response.

It works for me. Where did you put the macro (what module)?
I paste in in
-In the Sheet1 worksheet.


What version of Excel are you using (I have 2002)?
-I am using 2003

What is your macro security setting (Tools - Macro - Macro Security)?
-Low
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
copy data from sheet2 to sheet1 when sheet2 has variable # of rows Anne Excel Discussion (Misc queries) 6 February 27th 09 09:48 PM
A1 Sheet2 is linked to A1 sheet1 so that user enters value(abc123) a1 sheet1 and A1 sheet2 is updated pano[_3_] Excel Programming 2 October 28th 07 02:32 PM
copying data from sheet1 to sheet2 Rookie Excel Worksheet Functions 3 September 7th 06 12:09 PM
Copying records from sheet1 to sheet2?? j2dizzo Excel Programming 7 December 6th 05 03:29 PM
Copying Cells from Sheet2 to sheet1 Gary[_15_] Excel Programming 1 April 16th 04 09:10 AM


All times are GMT +1. The time now is 12:34 PM.

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

About Us

"It's about Microsoft Excel"