Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Write Data from Sheet1 to sheet2 Until
How would I go about coding a Loop to read rows of data from Sheet1 then write the data to Sheet2 until an empty row is encountered? Thanks for any assistance. -- cunning ------------------------------------------------------------------------ cunning's Profile: http://www.excelforum.com/member.php...o&userid=26738 View this thread: http://www.excelforum.com/showthread...hreadid=399965 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Write Data from Sheet1 to sheet2 Until
You did not indicate where to copy to. Meanwhile, how is this?
Range(ActiveCell, ActiveCell.End(xlDown)).EntireRow.copy sheets(2).range("....) YOu do not need looping "cunning" wrote: How would I go about coding a Loop to read rows of data from Sheet1 then write the data to Sheet2 until an empty row is encountered? Thanks for any assistance. -- cunning ------------------------------------------------------------------------ cunning's Profile: http://www.excelforum.com/member.php...o&userid=26738 View this thread: http://www.excelforum.com/showthread...hreadid=399965 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Write Data from Sheet1 to sheet2 Until
How the code will be written if the data from sheet1 is located in the
following cells: A1 B1 C1 D1 Then I want this data to written in the following cells of the sheet2: A1,A2,A3,A4 Thanks in advance.... Maperalia i "PY & Associates" wrote: You did not indicate where to copy to. Meanwhile, how is this? Range(ActiveCell, ActiveCell.End(xlDown)).EntireRow.copy sheets(2).range("....) YOu do not need looping "cunning" wrote: How would I go about coding a Loop to read rows of data from Sheet1 then write the data to Sheet2 until an empty row is encountered? Thanks for any assistance. -- cunning ------------------------------------------------------------------------ cunning's Profile: http://www.excelforum.com/member.php...o&userid=26738 View this thread: http://www.excelforum.com/showthread...hreadid=399965 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Write Data from Sheet1 to sheet2 Until
You can use transpose, looping. Generally you use
sheets(1).range("A1").copy sheets(2).range("A1") change "A" to suit "maperalia" wrote: How the code will be written if the data from sheet1 is located in the following cells: A1 B1 C1 D1 Then I want this data to written in the following cells of the sheet2: A1,A2,A3,A4 Thanks in advance.... Maperalia i "PY & Associates" wrote: You did not indicate where to copy to. Meanwhile, how is this? Range(ActiveCell, ActiveCell.End(xlDown)).EntireRow.copy sheets(2).range("....) YOu do not need looping "cunning" wrote: How would I go about coding a Loop to read rows of data from Sheet1 then write the data to Sheet2 until an empty row is encountered? Thanks for any assistance. -- cunning ------------------------------------------------------------------------ cunning's Profile: http://www.excelforum.com/member.php...o&userid=26738 View this thread: http://www.excelforum.com/showthread...hreadid=399965 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Write Data from Sheet1 to sheet2 Until
PY;
I have been doing the step you mentioned. However, I have to do it every time I entry the data in the sheet1 then copy transpose into sheet2. I wonder if I can be made automatically. So the data will be typed in the next empty row. Could you please tell me how to do it. Thanks in advance. Maperalia "PY & Associates" wrote: You can use transpose, looping. Generally you use sheets(1).range("A1").copy sheets(2).range("A1") change "A" to suit "maperalia" wrote: How the code will be written if the data from sheet1 is located in the following cells: A1 B1 C1 D1 Then I want this data to written in the following cells of the sheet2: A1,A2,A3,A4 Thanks in advance.... Maperalia i "PY & Associates" wrote: You did not indicate where to copy to. Meanwhile, how is this? Range(ActiveCell, ActiveCell.End(xlDown)).EntireRow.copy sheets(2).range("....) YOu do not need looping "cunning" wrote: How would I go about coding a Loop to read rows of data from Sheet1 then write the data to Sheet2 until an empty row is encountered? Thanks for any assistance. -- cunning ------------------------------------------------------------------------ cunning's Profile: http://www.excelforum.com/member.php...o&userid=26738 View this thread: http://www.excelforum.com/showthread...hreadid=399965 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Write Data from Sheet1 to sheet2 Until
I do not fully understand your problem.
You type in sheet1.row1, it appears in sheet2.column1 then you type in sheet1.row2, it appears in sheet2.column? or what is your expectation? Please elaborate. "maperalia" wrote: PY; I have been doing the step you mentioned. However, I have to do it every time I entry the data in the sheet1 then copy transpose into sheet2. I wonder if I can be made automatically. So the data will be typed in the next empty row. Could you please tell me how to do it. Thanks in advance. Maperalia "PY & Associates" wrote: You can use transpose, looping. Generally you use sheets(1).range("A1").copy sheets(2).range("A1") change "A" to suit "maperalia" wrote: How the code will be written if the data from sheet1 is located in the following cells: A1 B1 C1 D1 Then I want this data to written in the following cells of the sheet2: A1,A2,A3,A4 Thanks in advance.... Maperalia i "PY & Associates" wrote: You did not indicate where to copy to. Meanwhile, how is this? Range(ActiveCell, ActiveCell.End(xlDown)).EntireRow.copy sheets(2).range("....) YOu do not need looping "cunning" wrote: How would I go about coding a Loop to read rows of data from Sheet1 then write the data to Sheet2 until an empty row is encountered? Thanks for any assistance. -- cunning ------------------------------------------------------------------------ cunning's Profile: http://www.excelforum.com/member.php...o&userid=26738 View this thread: http://www.excelforum.com/showthread...hreadid=399965 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Write Data from Sheet1 to sheet2 Until
Hi Maperalia! I'm not very sure about your problem, but, maybe thi excercise will give you ideas... I'm assuming Sheet1 is where you type in your data and Sheet2 is wher you get the "transposed" results. In Sheet1 (VBA editor), put this code: Private Sub Worksheet_Change(ByVal Target As Range) Sheet2.Cells(Target.Column, Target.Row) = Target.Value End Sub The code above will transpose the data to Sheet2. If you enter in Sheet1: A1 - "hello" B1 - "world" C1 - "hello" D1 - "vba" Sheet2 will have: A1 - "hello" A2 - "world" A3 - "hello" A4 - "vba" But, (the side-effect) if you enter in Sheet1: A1 - "hello" A2 - "world" A3 - "hello" A4 - "vba" Sheet2 will have: A1 - "hello" B1 - "world" C1 - "hello" D1 - "vba" maperalia Wrote: How the code will be written if the data from sheet1 is located in the following cells: A1 B1 C1 D1 Then I want this data to written in the following cells of the sheet2: A1,A2,A3,A4 Thanks in advance.... Maperalia i "PY & Associates" wrote: You did not indicate where to copy to. Meanwhile, how is this? Range(ActiveCell, ActiveCell.End(xlDown)).EntireRow.copy sheets(2).range("....) YOu do not need looping "cunning" wrote: How would I go about coding a Loop to read rows of data from Sheet then write the data to Sheet2 until an empty row is encountered? Thanks for any assistance. -- cunning ------------------------------------------------------------------------ cunning's Profile http://www.excelforum.com/member.php...o&userid=26738 View this thread http://www.excelforum.com/showthread...hreadid=399965 -- T-®e ----------------------------------------------------------------------- T-®ex's Profile: http://www.excelforum.com/member.php...fo&userid=2657 View this thread: http://www.excelforum.com/showthread.php?threadid=39996 |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Write Data from Sheet1 to sheet2 Until
T-ex,
You are right this is exactly what I am looking for. However, when I typed new data in sheet1 it is overwriting it in sheet2. I wonder if the new data can be written in the following empty row of sheet2. I will really appreciate your helping me with this matter. Thanks again for your support Best regards. Maperalia "T-®ex" wrote: Hi Maperalia! I'm not very sure about your problem, but, maybe this excercise will give you ideas... I'm assuming Sheet1 is where you type in your data and Sheet2 is where you get the "transposed" results. In Sheet1 (VBA editor), put this code: Private Sub Worksheet_Change(ByVal Target As Range) Sheet2.Cells(Target.Column, Target.Row) = Target.Value End Sub The code above will transpose the data to Sheet2. If you enter in Sheet1: A1 - "hello" B1 - "world" C1 - "hello" D1 - "vba" Sheet2 will have: A1 - "hello" A2 - "world" A3 - "hello" A4 - "vba" But, (the side-effect) if you enter in Sheet1: A1 - "hello" A2 - "world" A3 - "hello" A4 - "vba" Sheet2 will have: A1 - "hello" B1 - "world" C1 - "hello" D1 - "vba" maperalia Wrote: How the code will be written if the data from sheet1 is located in the following cells: A1 B1 C1 D1 Then I want this data to written in the following cells of the sheet2: A1,A2,A3,A4 Thanks in advance.... Maperalia i "PY & Associates" wrote: You did not indicate where to copy to. Meanwhile, how is this? Range(ActiveCell, ActiveCell.End(xlDown)).EntireRow.copy sheets(2).range("....) YOu do not need looping "cunning" wrote: How would I go about coding a Loop to read rows of data from Sheet1 then write the data to Sheet2 until an empty row is encountered? Thanks for any assistance. -- cunning ------------------------------------------------------------------------ cunning's Profile: http://www.excelforum.com/member.php...o&userid=26738 View this thread: http://www.excelforum.com/showthread...hreadid=399965 -- T-®ex ------------------------------------------------------------------------ T-®ex's Profile: http://www.excelforum.com/member.php...o&userid=26572 View this thread: http://www.excelforum.com/showthread...hreadid=399965 |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Write Data from Sheet1 to sheet2 Until
Hi Maperalia! Can you please elaborate more? Maybe you can attach picture about what you would like done. If you enter in Sheet1: A1 - "the" B1 - "quick" C1 - "brown" D1 - "fox" and Sheet2 column A is still empty, should the result be: A1 - "the" A2 - "quick" A3 - "brown" A4 - "fox" ??? But when you enter in Sheet1: A1 - "jumps" B1 - "over" C1 - "the" D1 - "candle stick" and Sheet2 column A already has data, should the result be written i column B? B1 - "jumps" B2 - "over" B3 - "the" B4 - "candle stick" Is this what you like? I'd like to help but I'm a bit confused... maperalia Wrote: T-ex, You are right this is exactly what I am looking for. However, when typed new data in sheet1 it is overwriting it in sheet2. I wonder if the ne data can be written in the following empty row of sheet2. I will really appreciate your helping me with this matter. Thanks again for your support Best regards. Maperalia "T-®ex" wrote: Hi Maperalia! I'm not very sure about your problem, but, maybe this excercise will give you ideas... I'm assuming Sheet1 is where you type in your data and Sheet2 i where you get the "transposed" results. In Sheet1 (VBA editor), put this code: Private Sub Worksheet_Change(ByVal Target As Range) Sheet2.Cells(Target.Column, Target.Row) = Target.Value End Sub The code above will transpose the data to Sheet2. If you enter in Sheet1: A1 - "hello" B1 - "world" C1 - "hello" D1 - "vba" Sheet2 will have: A1 - "hello" A2 - "world" A3 - "hello" A4 - "vba" But, (the side-effect) if you enter in Sheet1: A1 - "hello" A2 - "world" A3 - "hello" A4 - "vba" Sheet2 will have: A1 - "hello" B1 - "world" C1 - "hello" D1 - "vba" maperalia Wrote: How the code will be written if the data from sheet1 is located i the following cells: A1 B1 C1 D1 Then I want this data to written in the following cells of th sheet2: A1,A2,A3,A4 Thanks in advance.... Maperalia i "PY & Associates" wrote: You did not indicate where to copy to. Meanwhile, how is this? Range(ActiveCell, ActiveCell.End(xlDown)).EntireRow.copy sheets(2).range("....) YOu do not need looping "cunning" wrote: How would I go about coding a Loop to read rows of data fro Sheet1 then write the data to Sheet2 until an empty row is encountered? Thanks for any assistance. -- cunning ------------------------------------------------------------------------ cunning's Profile: http://www.excelforum.com/member.php...o&userid=26738 View this thread: http://www.excelforum.com/showthread...hreadid=399965 -- T-®ex ------------------------------------------------------------------------ T-®ex's Profile http://www.excelforum.com/member.php...o&userid=26572 View this thread http://www.excelforum.com/showthread...hreadid=399965 -- T-®e ----------------------------------------------------------------------- T-®ex's Profile: http://www.excelforum.com/member.php...fo&userid=2657 View this thread: http://www.excelforum.com/showthread.php?threadid=39996 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to sheet1 data goes to sheet2 automaticaly ? | Excel Worksheet Functions | |||
copy data from sheet2 to sheet1 when sheet2 has variable # of rows | Excel Discussion (Misc queries) | |||
copying data from sheet1 to sheet2 | Excel Worksheet Functions | |||
How To Retrieve Data from Sheet2 into Sheet1 | Excel Worksheet Functions | |||
Transfer data from sheet1 to sheet2 | Excel Programming |