PC Review


Reply
Thread Tools Rate Thread

copying specific rows to an existing sheet, based on user paramete

 
 
=?Utf-8?B?Q2FybGVl?=
Guest
Posts: n/a
 
      2nd Apr 2007
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 With Quote
 
 
 
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      2nd Apr 2007
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a new sheet from specific data in existing sheet Rosscoe Microsoft Excel Misc 3 13th Jan 2010 06:08 PM
copy rows to new sheet based on specific cell value dlballard Microsoft Excel Worksheet Functions 4 18th Aug 2009 09:41 PM
need help please inserting multiple rows based on cell value then copying to data sheet tech@netsoft.net.nz Microsoft Excel Worksheet Functions 1 1st Jul 2007 08:44 PM
Copy Rows to New Sheet based on User Selection in Drop-down List =?Utf-8?B?Q2FybGVl?= Microsoft Excel Programming 0 2nd Apr 2007 04:46 PM
Copying specific rows from one sheet to another Chris Microsoft Excel Programming 1 16th Oct 2003 09:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:35 AM.