PDA

View Full Version : Solved: Copy to another sheet problem .



parscon
02-23-2012, 03:46 AM
I have A-B-C-D-E-F-G-H-I-J column , but for some row i do not have any data on column A-B-C-D in sheet A, just i have data on cloum E-F ... , when use this code it , shopy all data to another sheet

in second sheet column for some row i do not have any data on column A-B-C-D but when use another data it will repleace with this , it will not copy to another row .



Worksheets("Sheet1").Range("A1").Copy _
Worksheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1)
Application.CutCopyMode = False

Bob Phillips
02-23-2012, 06:32 AM
With Worksheets("Sheet2")

Worksheets("Sheet1").Range("A1").Copy _
.Range("A" & .UsedRange.Rows.Count.UsedRange.Cells(1, 1).Row - 1).Offset (1)
End With
Application.CutCopyMode = False

raji2678
02-23-2012, 11:03 PM
As far as my understanding goes, you do not want to copy the blank columns. You can write a simple macro to check that the column is not blank.

Bob Phillips
02-24-2012, 03:16 AM
As far as my understanding goes, you do not want to copy the blank columns. You can write a simple macro to check that the column is not blank.

My understanding is that he is overwriting rows that are blank in the first few columns because his last row finder is missing those blanks.

parscon
02-24-2012, 07:04 AM
My understanding is that he is overwriting rows that are blank in the first few columns because his last row finder is missing those blanks.

yes , exactly and it is work now , thank you so much ..