LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default totally newbie question about macros and programing it

Glad to help out....

Mark Ivey

"Dexter" wrote in message
...

thank you!!its working perfect and i will make some modifications to
customize it for my needs
thank you
Mark Ivey wrote:
See if this will work for your needs...

Mark Ivey


Sub test()
Dim mySize As Integer
Dim myType As String
Dim myQuantity As Integer
Dim myNumber As Integer
Dim myResult As Long

mySize = InputBox("Input your desired size", "Input Size")
If mySize = 25 And mySize <= 35 Then
myType = "A"
ElseIf mySize = 36 And mySize <= 45 Then
myType = "B"
ElseIf mySize = 46 And mySize <= 55 Then
myType = "C"
Else: myType = ""
MsgBox "Please input a size between 25 to 55"
Exit Sub
End If


myQuantity = InputBox("Input a quantity", "Input Quantity")
If myQuantity < 1 Or myQuantity 50 Then
MsgBox "Please input a quantity between 1 to 50"
Exit Sub
End If


myNumber = InputBox("Input a number", "Input Number")
If myNumber < 5 Or myNumber 20 Then
MsgBox "Please input a number between 5 to 20"
Exit Sub
End If


myResult = (mySize * myQuantity) / myNumber

MsgBox "Type: " & myType & vbCrLf & vbCrLf & _
"Result: " & myResult, vbOKOnly

End Sub


 
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 question borderline programing gimp New Users to Excel 1 June 25th 06 06:01 AM
totally newbie to VBA need help cuongvt Excel Programming 1 September 29th 05 06:24 AM
Microsoft excel macros Programing. Roberto Torres Perez Excel Programming 1 May 13th 05 09:18 AM
Sharing macros - extreme newbie question I know. rfalke[_2_] Excel Programming 1 October 13th 04 07:56 PM
Sharing macros - extreme newbie question I know. rfalke Excel Programming 1 October 13th 04 06:08 PM


All times are GMT +1. The time now is 07:08 PM.

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

About Us

"It's about Microsoft Excel"