Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
New to Userforms - need return value in a cell
I have never programmed for a userform before, so I may need precise help here.
On a worksheet tab called 'Tables', I have a list of ZIP Codes with City and County. The single column of ZIP Codes is a named range (ZIPS). Some of the ZIP Codes are in the table two times, for instance, 90028.1 / Hollywood N of Sunset / Los Angeles (County) 90028.2 / Hollywood S of Sunset / Los Angeles 90038.1 / Hollywood N of Santa Monica / Los Angeles 90038.2 / Hollywood S of Santa Monica / Los Angeles What I am looking for is when a user enters the ZIP Code of 90028, I would like the userform to come up with 2 buttons on it with the 'City' description. After selecting one of the buttons, I would like the user-entered 90028 to change to 90028.1 or .2. Row 86 = user-entered ZIP Code - I have Data Validation to only allow ZIPs which are allowed, and because of this, I have also entered 90028 and 90038 into the ZIP Code list. For City and County, I have entered "*". Row 87 = VLOOKUP City; 88 = County I already have a Worksheet_Change event, with a Select Target.Row Case 86 If Target.Offset(1,0).Value = "*" then 'I am not positive how to call the userform. End If I also have the 'SplitZIP' userform created, but I need help changing the Caption depending on which ZIP Code is selected. Lastly, if the cmdSplit1 (cmdSplit2) button is selected on 'SplitZIP', I need to add 0.1 (0.2) to the user-entered ZIP Code. -- Sorry it's so long and TIA, Brad E. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
New to Userforms - need return value in a cell
1) Make the Buttons on the Userform
2) Double Click the Button .. (should Take you to the Click event code) 3) in onClick Event for each Button .. Cells(row,Column).Value=90028.1 or Cells(row,Column).Value=90028.2 Hope that Helps Andrew ;-) "Brad E." wrote in message ... |I have never programmed for a userform before, so I may need precise help here. | On a worksheet tab called 'Tables', I have a list of ZIP Codes with City and | County. The single column of ZIP Codes is a named range (ZIPS). | Some of the ZIP Codes are in the table two times, for instance, | 90028.1 / Hollywood N of Sunset / Los Angeles (County) | 90028.2 / Hollywood S of Sunset / Los Angeles | 90038.1 / Hollywood N of Santa Monica / Los Angeles | 90038.2 / Hollywood S of Santa Monica / Los Angeles | What I am looking for is when a user enters the ZIP Code of 90028, I would | like the userform to come up with 2 buttons on it with the 'City' | description. After selecting one of the buttons, I would like the | user-entered 90028 to change to 90028.1 or .2. | | Row 86 = user-entered ZIP Code - I have Data Validation to only allow ZIPs | which are allowed, and because of this, I have also entered 90028 and 90038 | into the ZIP Code list. For City and County, I have entered "*". | Row 87 = VLOOKUP City; 88 = County | I already have a Worksheet_Change event, with a Select Target.Row | Case 86 | If Target.Offset(1,0).Value = "*" then | 'I am not positive how to call the userform. | End If | I also have the 'SplitZIP' userform created, but I need help changing the | Caption depending on which ZIP Code is selected. Lastly, if the cmdSplit1 | (cmdSplit2) button is selected on 'SplitZIP', I need to add 0.1 (0.2) to the | user-entered ZIP Code. | -- | Sorry it's so long and TIA, Brad E. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can userforms be embedded in a spreadsheet cell? | Excel Programming | |||
UserForms - how to return a value? | Excel Programming | |||
Compare Value in Cell 1 to a List, Return Value if Match otherwise Return Null | Excel Discussion (Misc queries) | |||
Return values from UserForms | Excel Programming | |||
cell ranges to userforms | Excel Programming |