#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 versus Excel 2003 & Excel 97-2003 fully compatible Bumpersnesty Excel Worksheet Functions 0 April 26th 10 09:44 PM
importing/linking data from an Access 2003 Query to an Excel 2003 PerryK Excel Discussion (Misc queries) 2 August 24th 09 07:06 PM
import Excel 2003 file into Outlook 2003 - NO NAMED RANGES?? lewisma9 Excel Discussion (Misc queries) 0 February 27th 07 12:23 AM
Copying Excel 2003 Selection into Outlook 2003 HTML E-Mail Message [email protected] Excel Discussion (Misc queries) 0 July 10th 06 03:07 PM
Word 2003 Find/Change Automation from Excel 2003 crashes Excel 200 Joel Berry Excel Programming 9 March 6th 06 10:20 PM


All times are GMT +1. The time now is 05:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"