Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy Rows to Existing Worksheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Copy Rows to Existing Worksheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy Rows to Existing Worksheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Copy Rows to Existing Worksheets

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
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 Rows with a cell value 0 from several worksheets to a new sh Skeletor Excel Worksheet Functions 1 October 6th 08 09:37 PM
Copy Rows with a cell value 0 from several worksheets to a new sh Skeletor Excel Worksheet Functions 4 October 2nd 08 09:24 AM
Copy Rows with a cell value 0 from several worksheets to a new sh Skeletor Excel Worksheet Functions 5 October 1st 08 02:46 AM
Copy rows with a cell value 0 from several worksheets to a new sh Skeletor Excel Worksheet Functions 3 September 30th 08 09:45 AM
Formatting worksheets, existing and new, in existing workbooks G. Dagger[_2_] Excel Discussion (Misc queries) 4 January 7th 08 06:48 PM


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