LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Copy a range instead of just one row but with condition

Hi Everyone
The small macro below copies the information from row 20 on to an order form
sheet.
I need to have it check from row 20 to row 36 and copy it if column B starts
with a number.
Your help is always appreciated. Thank you
Sub Parts_Order()
With Sheets("Parts Order Form")
'QTY
lLastRow = .Cells(.Rows.Count, "a").End(xlUp).Row
.Cells(lLastRow + 1, "a").Value = _
Sheets("Invoice").Range("A20").Value
'Part Number
lLastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
.Cells(lLastRow + 1, "B").Value = _
Sheets("Invoice").Range("b20").Value
End With
End Sub
Sub Parts_Order()
'Invoice Number
lLastRow = .Cells(.Rows.Count, "d").End(xlUp).Row
.Cells(lLastRow + 1, "d").Value = _
Sheets("Invoice").Range("K2").Value
'QTY
lLastRow = .Cells(.Rows.Count, "a").End(xlUp).Row
.Cells(lLastRow + 1, "a").Value = _
Sheets("Invoice").Range("A20").Value
'Part Number
lLastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
.Cells(lLastRow + 1, "B").Value = _
Sheets("Invoice").Range("b20").Value
End With
End Sub
Regards
Cimjet

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Condition based copy/paste of range [email protected] Excel Programming 1 April 28th 07 11:30 PM
Condition based copy/paste of range [email protected] Excel Programming 1 April 27th 07 12:44 PM
Condition based copy/paste of range [email protected] Excel Programming 0 April 27th 07 05:48 AM
Copy range based on condition Sotomayor Excel Programming 1 September 10th 06 01:11 AM
Create/copy combo boxes in one range if condition is met in a different range LB[_4_] Excel Programming 4 September 30th 05 12:21 AM


All times are GMT +1. The time now is 04:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"