![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Jan 2002
Posts: 9
|
Two sheet workbook. Sheet A is a form that fills in customer information based on a drop down box that they select from (cell J4). The drop down box is just a customer number and depending on what they select it fills in the detail - customer name, etc. The user has one blank field in the form to fill in. It's a date (cell c14).
I want a macro that will look at the drop down box (sheetA!J4) to see what they selected and then go to Sheet B and find that customer number (number is listed in column B [a whole bunch of them]) and then place the date in column C next to the right customer number. I want a macro to do this since I have a macro that prints out an agreement based on the customer and would like to combine it with my other so that the user has it easy. Can someone help? I have gotten a kick out of VBA and am very green but have had fun learning some of it. I plan to purchase a book this weekend to help with the rest of the project. Thanks! |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Aug 2003
Location: England
Posts: 4,644
|
Hello,
I know you posted this a long time ago, but I have only recently registered, and am trying to work my way through the unanswered posts, to gain as much experience as possible. I don't know if you need this any more, but I think I have come up with a solution. Add the following code and assign the macro to the drop down box. Option Explicit Dim CUST_NO As Single Sub Macro1() Range("j4").Select CUST_NO = ActiveCell Sheets("Sheet B").Select Cells.Find(What:=CUST_NO, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _ xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _ ).Activate ActiveCell.Offset(0, 1).Select ActiveCell.FormulaR1C1 = "=TODAY()" Selection.Copy Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Application.CutCopyMode = False End Sub Hope this helps.
__________________
------------------------- Hope this is helpful. ------------------------- only a drafter, but broadening my Excel knowledge. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|