Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel 2003
I have a blank invoice layout in excel.
I need to have it ask the user when they either open the file or when they click on cell for customer # user then enters it -select enter excel then goes to my sql db and finds customer # and pulls and populates sold to address area in excel, then prompts user for ship to same as sold -yes or no. if yes fill in ship to if no then user can fill this in. Any ideas on how to do this |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel 2003
On May 9, 5:44 pm, lyeoman wrote:
I have a blank invoice layout in excel. I need to have it ask the user when they either open the file or when they click on cell for customer # user then enters it -select enter excel then goes to my sql db and finds customer # and pulls and populates sold to address area in excel, then prompts user for ship to same as sold -yes or no. if yes fill in ship to if no then user can fill this in. Any ideas on how to do this Just use the Workbook_Open event to fire the code as soon as it is opened. Store the users customer # entry in a variable and pass that to your Microsoft Query code. After it is returned, you a MsgBox with a vbYesNo button to ask about the shipping. If the user selects vbYes, fill in the shipping info. That's about as much help as I can give without seeing the spreadsheet. HTH -Jeff- |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel 2003
Assume customer # in Range("A1"), code goes in ThisWorkbook module:
Private Sub Workbooks_Open() Range("A1").Activate If Cells(1, 1) < "" Then Cells(1, 1).ClearContents End If Cells(1, 1) = InputBox("Enter Customer Number for data required.", "CUSTOMER NUMBER") '<Call SQLMacro You will need to provide this ShpAddrs = MsgBox("IS THE SHIP TO ADDRESS THE SAME AS _ THE SOLD TO ADDRESS?", vbYesNo + vbQuestion, "SHIPPING ADDRESS" If ShpAddrs = vbNo Then ShpTo = InputBox(Enter the shipping address for this order.", "SHIP TO") Range(NeedToDesignate) = ShpTo 'Need to determine Range End If End Sub I'm not sure what your SQL db is so you will have to work that out. The rest of the code should give you an idea of how to do it. It is just a matter of using InputBoxes and Message Boxes to get the user to respond. "lyeoman" wrote: I have a blank invoice layout in excel. I need to have it ask the user when they either open the file or when they click on cell for customer # user then enters it -select enter excel then goes to my sql db and finds customer # and pulls and populates sold to address area in excel, then prompts user for ship to same as sold -yes or no. if yes fill in ship to if no then user can fill this in. Any ideas on how to do this |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 versus Excel 2003 & Excel 97-2003 fully compatible | Excel Worksheet Functions | |||
importing/linking data from an Access 2003 Query to an Excel 2003 | Excel Discussion (Misc queries) | |||
import Excel 2003 file into Outlook 2003 - NO NAMED RANGES?? | Excel Discussion (Misc queries) | |||
Copying Excel 2003 Selection into Outlook 2003 HTML E-Mail Message | Excel Discussion (Misc queries) | |||
Word 2003 Find/Change Automation from Excel 2003 crashes Excel 200 | Excel Programming |