Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro to copy only range with data
HI...
my data range area is from A1:B5..... How I going to copy only the range with data... ( my range of data keep on changing but within A1:B5. e.g the data is located at A1:B2, so the macro will ignore A3:B5. rgds |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro to copy only range with data
Hi,
Try this Range("A1:B" & Range("B6").End(xlUp).Row).Copy Note B6 isn't a typo, this works for A1 - B5 Mike "ramzi" wrote: HI... my data range area is from A1:B5..... How I going to copy only the range with data... ( my range of data keep on changing but within A1:B5. e.g the data is located at A1:B2, so the macro will ignore A3:B5. rgds |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro to copy only range with data
Hi Mike,
my original macro is below... Range("d9:j15,O9:O15").Copy lastrow = Sheets("sale").Cells(Cells.Rows.Count, "A").End(xlUp).Row + 1 Sheets("sale").Range("A" & lastrow).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False but my data not always from row 9 to 15 , sometime only at row 9 or only at row 9 to 10... I need macro to pick up the watever written in row form 9 to 15.. if row 15 is blank the macro will select row 9 to 14 and do copy paste. thanks "Mike H" wrote: Hi, Try this Range("A1:B" & Range("B6").End(xlUp).Row).Copy Note B6 isn't a typo, this works for A1 - B5 Mike "ramzi" wrote: HI... my data range area is from A1:B5..... How I going to copy only the range with data... ( my range of data keep on changing but within A1:B5. e.g the data is located at A1:B2, so the macro will ignore A3:B5. rgds |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro to copy range | Excel Worksheet Functions | |||
Copy Range Data Macro | Excel Discussion (Misc queries) | |||
Need help - Macro to copy a specific range | Excel Worksheet Functions | |||
MACRO TO COPY TO A RANGE | Excel Discussion (Misc queries) | |||
Macro to copy range of formulas to equal data lines | Excel Worksheet Functions |