Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I need to copy a number of rows from a master worksheet to existin worksheets within the same work book. Ideally i would like to check the values of one column and send tha row to the corresponding worksheet based on the result. e.g. check row 1 and if Value in Column H = Blue, send entire row to worksheet 'Blue'. repeat for all rows in master sheet. Hope i am making sense and that someone can help. thanks, Hamis -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
how about something like
Sub copyblue() For Each c In Range("e2:e22") If UCase(c) = "B" Then x = Sheets("sheet4").Cells(Rows.Count, "a") _ ..End(xlUp).Row + 1 c.EntireRow.Copy Sheets("Sheet4").Cells(x, "a") End If Next End Sub -- Don Guillett SalesAid Software "HamishM" wrote in message ... Hi, I need to copy a number of rows from a master worksheet to existing worksheets within the same work book. Ideally i would like to check the values of one column and send that row to the corresponding worksheet based on the result. e.g. check row 1 and if Value in Column H = Blue, send entire row to worksheet 'Blue'. repeat for all rows in master sheet. Hope i am making sense and that someone can help. thanks, Hamish --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Don.
I'm quite new to VBA so could you explain what each of the lines ar doing and the variables? Appreciate your help Hamis -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Macro is looking for cells that contain "b" or "B" in the range and copying
the row to next available row on sheet 4 in col A. The line with the space & underscore ( _ ) is a "continuation" character to make the line into one line. Sub copyblue() For Each c In Range("e2:e22") If UCase(c) = "B" Then x = Sheets("sheet4").Cells(Rows.Count, "a") _ ..End(xlUp).Row + 1 c.EntireRow.Copy Sheets("Sheet4").Cells(x, "a") End If Next End Sub -- Don Guillett SalesAid Software "HamishM" wrote in message ... Thanks Don. I'm quite new to VBA so could you explain what each of the lines are doing and the variables? Appreciate your help Hamish --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy Rows with a cell value 0 from several worksheets to a new sh | Excel Worksheet Functions | |||
Copy Rows with a cell value 0 from several worksheets to a new sh | Excel Worksheet Functions | |||
Copy Rows with a cell value 0 from several worksheets to a new sh | Excel Worksheet Functions | |||
Copy rows with a cell value 0 from several worksheets to a new sh | Excel Worksheet Functions | |||
Formatting worksheets, existing and new, in existing workbooks | Excel Discussion (Misc queries) |