Goliath.ro
New Member
- Joined
- Aug 26, 2011
- Messages
- 3
Hello
I am kinda stuck, I am a noob at excel coding
I want 1 row from sheet 2 copied to first empty row from sheet 1 but aligned to the right as in:
sheet 2:
would be copied in sheet 1
So far I was thinking to do a macro like this ( keep in mind this macro is incomplete and for clarification my example sheet 2 contains 2 rows when in reality its the same row that will be copied over and over with different data in the first empty row in sheet 1)
Sheets("Sheet2").Select
Range("B2").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Sheet1").Select
Range("H2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
and now I want it to offset to the left depending on ho many cells are writen in sheet 2
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Any1 have any sugestions ?
I am kinda stuck, I am a noob at excel coding
I want 1 row from sheet 2 copied to first empty row from sheet 1 but aligned to the right as in:
sheet 2:
Code:
A B C D E F G H
1 1 2 3 4 5 6 7
2 ab cd ef
3 ab ad cd df
Code:
A B C D E F G H
1 1 2 3 4 5 6 7
2 ab cd ef
3 ab ad cd ef
So far I was thinking to do a macro like this ( keep in mind this macro is incomplete and for clarification my example sheet 2 contains 2 rows when in reality its the same row that will be copied over and over with different data in the first empty row in sheet 1)
Sheets("Sheet2").Select
Range("B2").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Sheet1").Select
Range("H2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
and now I want it to offset to the left depending on ho many cells are writen in sheet 2
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Any1 have any sugestions ?