? how to pull data from another sheet based on value

G

Guest

I want to put a value in a cell on SheetB for todays day (monday, tuesday,
etc.) and based on that value i want to pull data from the column on SheetA
that has the valuse for that day and put it into a corresponding column in
SheetB.

So if i type in Monday on SheetB, I want to have the data in the Monday
column in SheetA be copied into SheetB. The data will be in multiple rows in
the column.

not sure if that makes sense but any help would be greatly appreciated.
 
D

Don Guillett

The macro recorder can help you learn. Here I selected the header row of the
data base and used data>filter>autofilter>filtered for monday>copied to the
other sheet. Of course, this can be greatly enhanced by removing all of the
selections. Assumes you had mon, tue, wed, etc typed in col b of the source
sheet.
this should get you started.

Sub Macro6()
'
' Macro6 Macro
' Macro recorded 12/16/2005 by Don Guillett
'

'
Range("A4:B4").Select
Selection.AutoFilter
Selection.AutoFilter Field:=2, Criteria1:="Mon"
Range("A8:B15").Select
Selection.Copy
Sheets("5 production worksheet").Select
Range("C8").Select
ActiveSheet.Paste
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top