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: 8
Default Copy rows to master sheet

Can someone please help? I am very new to coding excel and am running
into problems constantly. I am on a tight deadline and am frightened
I am not going to make it. I am trying to copy the entire row from
one sheet to a master if the value in one of the columns is greater
than zero. I have read through all the postings I can find on the
subject - which has been helpful. The code that I have come up with
is copying everything. Also, how would I get the copied cells to
start in a row other than 1? I need to put additional reference
information in the beginning of the sheet.

I have a command button at the bottom of the sheet - which is named
chemicals - that is to start the macro.

Private Sub CommandButton1_Click()
myObject = Range("chemcounts")
Set myObject = Range("chemcounts")
Range("chemcounts").Select
Selection.Copy
Dim msg As String
msg = "Your order has been sent to the order form"
MsgBox (msg)
Dim Sh1 As Worksheet, Sh2 As Worksheet
Dim rng1 As Range, Cell As Range
Dim DestRow As Long

Set Sh1 = Worksheets("Chemicals")
Set Sh2 = Worksheets("Master")
DestRow = 1
Set rng1 = Sh1.Range("A1").CurrentRegion
Set rng1 = Intersect(rng1, Sh1.Columns(5))
' move range to start in row 2
Set rng1 = rng1.Offset(1, 0). _
Resize(rng1.Rows.Count - 1)
For Each Cell In rng1
If UCase(Cell.Value) 0 Then
Cell.EntireRow.Copy _
Destination:=Sh2.Cells(DestRow, 1)
DestRow = DestRow + 1
End If
Next Cell

Thank you in advance for any help.

Carolyn
 
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
copy data from master sheet new aditya New Users to Excel 2 June 9th 09 01:44 PM
copy data from master sheet aditya New Users to Excel 6 June 8th 09 08:42 PM
copy data from master sheet Sean Timmons Excel Discussion (Misc queries) 0 June 3rd 09 03:19 PM
copy data from master sheet aditya Excel Discussion (Misc queries) 3 June 3rd 09 02:28 PM
Copy rows to master sheet Carolyn[_3_] Excel Programming 4 May 23rd 04 07:19 PM


All times are GMT +1. The time now is 03:11 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"