-----Original Message-----
Dear Sirs/Madams of this group,
I am slightly new to VBA programming in
Excel and i'm working on a project. I'm stumped on the code which i
would write to summarize what i have entered into my worksheet via a
userform. Could somebody please help me with any kind of instructions
on how i could summarize what i have entered by placing all the
variables into a message box. For eg. i'm entering the details of a
trade, and i want it to confirm for me that the details i entered are
correct by displaying them in a msgbox form.
Your suggestions will be greatly appreciated.
.
I'm pretty new at this stuff too. If I'm understanding
your question correctly, here are a couple of samples of
what I have used.
The first simply shows a Message Box with 2 lines of
text. CHR(103) and CHR(10) being a carriage return and a
line feed.
If ComboBox15.Value = "" Then
mbResponse1 = MsgBox("No play date has been selected." &
Chr(13) & Chr(10) & " You must select a date before
pressing the ACCEPT button!", vbOKCancel)
End If
This example starts with an Input Box. I'm entering the
data and if that value is 999, then go through and enter
individual scores for each game through the use of an
Input Box for each. After entering all the data, I've
put the results into a MsgBox at the end of the code. As
you can see, I have joined all the information to be put
into the MsgBox into the variable, aveResult.
newAve = InputBox("Enter starting average. If none,
enter 999.")
aveStart = newAve
If newAve = 999 Then
Message = "Enter 1st game score for " + newName
newGame1 = InputBox(Message, , , 5000, 3000)
Message = "Enter 2nd game score for " + newName
newGame2 = InputBox(Message, , , 5000, 3300)
Message = "Enter 3rd game score for " + newName
newGame3 = InputBox(Message, , , 5000, 3600)
aveStart = Int(Val(newGame1) + Val(newGame2) + Val
(newGame3)) / 3
aveResult = "Starting average for " & newName & "
will be " & Int(aveStart) & "."
Response = MsgBox(aveResult)
End If
You should be able to just paste this code into a module
to try it out to see what is looks like and if it's what
you are looking for.
You can certainly put the values of particular cells in
place of variables defined in VBA code.
When you are working on your code, if you move your
cursor over the InputBox or MsgBox and press the F1 key,
you should get some good help information to show you how
to position the box or what type of buttons you want to
show, etc. It worked for me anyway!
Hope this helps!
Regards,
speedking1621