Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default copying specific rows to an existing sheet, based on user paramete

Hi everyone,

I have a master sheet ("Master Sheet") containing rows of data. Each row
has a specific date. I want the system to select a month (1-12) from a
drop-down list, and click continue. On click, I want the system to copy all
rows matching the month value selected by the user, to an existing worksheet
("sheet 5")

can anyone help me out on this?
--
Carlee
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default copying specific rows to an existing sheet, based on user paramete

I had the drop down cell in cell D4 (Row 2 column 4). I also have column A
searcdhed for the value matching the drop down value starting in row 20. the
code belows adds new rows to sheet5 after the rows that already exist.


Sub worksheet_change(ByVal Target As Range)

If Target.Row = 2 And Target.Column = 4 Then

Sheet5RowCount = _
Sheets("sheet5").Cells(Rows.Count, 1).End(xlUp).Row + 1

'find last row in column A
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
Set ColARange = Range(Cells(20, 1), Cells(lastrow, 1))


For Each cell In ColARange


If cell = Target Then

cell.EntireRow.Copy _
Destination:=Sheets("sheet5").Cells(Sheet5rowCount , 1)

Sheet5rowCount = Sheet5rowCount + 1
End If

Next cell
End If

End Sub


"Carlee" wrote:

Hi everyone,

I have a master sheet ("Master Sheet") containing rows of data. Each row
has a specific date. I want the system to select a month (1-12) from a
drop-down list, and click continue. On click, I want the system to copy all
rows matching the month value selected by the user, to an existing worksheet
("sheet 5")

can anyone help me out on this?
--
Carlee

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 to new sheet based on specific cell value dlballard Excel Worksheet Functions 5 April 24th 23 11:44 AM
Creating a new sheet from specific data in existing sheet Rosscoe Excel Discussion (Misc queries) 2 January 13th 10 03:07 PM
need help please inserting multiple rows based on cell value then copying to data sheet [email protected] Excel Worksheet Functions 1 July 1st 07 08:44 PM
Copying specific rows Eric Montelongo Excel Worksheet Functions 1 June 20th 06 08:08 PM
Copying specific rows from one sheet to another Chris Excel Programming 2 October 17th 03 11:40 PM


All times are GMT +1. The time now is 06:58 PM.

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

About Us

"It's about Microsoft Excel"