Copy data from one sheet to another while skipping blanks and certain rows

tlc1980

New Member
Joined
Feb 13, 2013
Messages
19
Hi. I'm trying to copy data from one sheet to another, but I want it to skip blanks and a row that has data on it.

I want C9:C12, C14:C17, C19:C22, C24:C27, and C29:C34 from Sheet1 to be moved to A8:A33 on Sheet 2.

Rows 13, 18, 23, and 28 on Sheet1 need to be left out.

Thank you in advance for your help!
 
I am reading from a sheet named dps from cells (HR282:AHR388, AHT282:AHT388, AHV282:AHV388, AHX282:AHX388, AHZ282:AHZ388, AIB282:AIB388, AID282:AID388, AIF282:AIF388, AIH282:AIH388, AIJ282:AIJ388, AIL282:AIL388, AIN282:AIN388, AIP282:AIP388, AIR282:AIR388, AIT282:AIT388, AIV282:AIV388, AIX282:AIX388,AIZ282:AIZ388, AJB282:AJB388, AJD282:AJD388, AJF282:AJF388, AJH282:AJH388, AJJ282:AJJ388, AJL282:AJL388, AJN282:AJN388, AJP282:AJP388, AJR282:AJR388, AJT282:AJT388, AJV282:AJV388, AJX282:AJX388, AJZ282:AJZ388, AKB282:AKB388, AKD282:AKD388, AKF282:AKF388,AKH282:AKH388, AKJ282:AKJ388, AKL282:AKL388, AKN282:AKN388) in another sheet (sheet4) in column A.

But when i divided above vb code into Sub Copy_Stuff1(), Sub Copy_Stuff2() & Sub Copy_Stuff3() it was not reading data after 17 column.
 
Last edited:
Upvote 0

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
i m now using this one ..


<code style="margin: 0px; padding: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-size: 1em; line-height: normal; font-family: Monaco, 'Courier New', monospace;">Sub Copy_Stuff1() Dim cell As Range, r As Long r = 2 Application.ScreenUpdating = False Sheets("Sheet4").Range("A2:A3000").ClearContents For Each cell In Sheets("dps").Range("AHR282:ALF388 ") If Not IsNumeric(cell.Value) And Len(cell.Value) > 0 Then Sheets("Sheet4").Range("A" & r).Value = cell.Value r = r + 1 End If Next cell Application.ScreenUpdating = True End Sub</code>

Can i link date from location (AHR6:ALF6) when i copy to sheet4 in column B?

 
Last edited:
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top