Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default currency in vba userform

Trying to set up a userform to enter weekly sales figures for various items
i.e, bottles,cans, plastic with text boxes used for dollar amount input and
then dump the data into a the spreadsheet. The sheet cells are formated as
"currency" but when I run the userform the data is sent as text, the cells
display i.e 2000 and an error message appears relating to format.

Tried to DIM the variables and .Value [currency] to no avail. All the
spreadsheet shows $0.00 irregardless of what was entered in the userform.

I think the problem may be Property Set related but I'm not that experienced
with it but then again it could be something really simple I'm missing.

Any help provided would be greatly appreciated.

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default currency in vba userform

Show the code.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"harrar" wrote in message
...
Trying to set up a userform to enter weekly sales figures for various

items
i.e, bottles,cans, plastic with text boxes used for dollar amount input

and
then dump the data into a the spreadsheet. The sheet cells are formated

as
"currency" but when I run the userform the data is sent as text, the cells
display i.e 2000 and an error message appears relating to format.

Tried to DIM the variables and .Value [currency] to no avail. All the
spreadsheet shows $0.00 irregardless of what was entered in the userform.

I think the problem may be Property Set related but I'm not that

experienced
with it but then again it could be something really simple I'm missing.

Any help provided would be greatly appreciated.

Thanks in advance



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default currency in vba userform

Sorry about that, Bob
Here's a sample of the coding for the userform:

Private Sub cmdCancel_Click()
Unload Me
End Sub

Private Sub cmdClear_Click()
Call UserForm_Initialize
End Sub

Private Sub cmdEnter_Click()
Sheet1.Select
If combWeek = "1" Then
Range("b6").Value = tbLiq
Range("c6").Value = tbDraft
Range("d6").Value = tbBottle
Range("e6").Value = tbCan
Range("f6").Value = tbWine
Range("g6").Value = tbSoda
ElseIf combWeek = "2" Then
Range("b15").Value = tbLiq
Range("c15").Value = tbDraft
Range("d15").Value = tbBottle
Range("e15").Value = tbCan
Range("f15").Value = tbWine
Range("g15").Value = tbSoda
ElseIf combWeek = "3" Then
Range("b25").Value = tbLiq
Range("c25").Value = tbDraft
Range("d25").Value = tbBottle
Range("e25").Value = tbCan
Range("f25").Value = tbWine
Range("g25").Value = tbSoda
ElseIf combWeek = "4" Then
Range("b35").Value = tbLiq
Range("c35").Value = tbDraft
Range("d35").Value = tbBottle
Range("e35").Value = tbCan
Range("f35").Value = tbWine
Range("g35").Value = tbSoda
ElseIf combWeek = "5" Then
Range("b45").Value = tbLiq
Range("c45").Value = tbDraft
Range("d45").Value = tbBottle
Range("e45").Value = tbCanned
Range("f45").Value = tbWine
Range("g45").Value = tbSoda
ElseIf combWeek = "6" Then
Range("b55").Value = tbLiq
Range("c55").Value = tbDraft
Range("d55").Value = tbBottle
Range("e55").Value = tbCanned
Range("f55").Value = tbWine
Range("g55").Value = tbSoda

End If
End Sub
Private Sub UserForm_Initialize()

tbLiq.Value = "0.00"
tbDraft.Value = "0.00"
tbBottle.Value = "0.00"
tbCan.Value = "0.00"
tbWine.Value = "0.00"
tbSoda.Value = "0.00"

With combWeek
..AddItem "1"
..AddItem "2"
..AddItem "3"
..AddItem "4"
..AddItem "5"
..AddItem "6"
..AddItem "7"
..AddItem "8"
..AddItem "9"
..AddItem "10"
..AddItem "11"
End With
combWeek.Value = "1"
combWeek.SetFocus

End Sub


"Bob Phillips" wrote:

Show the code.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"harrar" wrote in message
...
Trying to set up a userform to enter weekly sales figures for various

items
i.e, bottles,cans, plastic with text boxes used for dollar amount input

and
then dump the data into a the spreadsheet. The sheet cells are formated

as
"currency" but when I run the userform the data is sent as text, the cells
display i.e 2000 and an error message appears relating to format.

Tried to DIM the variables and .Value [currency] to no avail. All the
spreadsheet shows $0.00 irregardless of what was entered in the userform.

I think the problem may be Property Set related but I'm not that

experienced
with it but then again it could be something really simple I'm missing.

Any help provided would be greatly appreciated.

Thanks in advance




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default currency in vba userform

Is the problem with the Cans on week 5 & 6? You have a wrong textbox name
there, you use tbCanned where elsewhere you use tbCan.

If you used Option Explicit in your code, that would not be a problem.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"harrar" wrote in message
...
Sorry about that, Bob
Here's a sample of the coding for the userform:

Private Sub cmdCancel_Click()
Unload Me
End Sub

Private Sub cmdClear_Click()
Call UserForm_Initialize
End Sub

Private Sub cmdEnter_Click()
Sheet1.Select
If combWeek = "1" Then
Range("b6").Value = tbLiq
Range("c6").Value = tbDraft
Range("d6").Value = tbBottle
Range("e6").Value = tbCan
Range("f6").Value = tbWine
Range("g6").Value = tbSoda
ElseIf combWeek = "2" Then
Range("b15").Value = tbLiq
Range("c15").Value = tbDraft
Range("d15").Value = tbBottle
Range("e15").Value = tbCan
Range("f15").Value = tbWine
Range("g15").Value = tbSoda
ElseIf combWeek = "3" Then
Range("b25").Value = tbLiq
Range("c25").Value = tbDraft
Range("d25").Value = tbBottle
Range("e25").Value = tbCan
Range("f25").Value = tbWine
Range("g25").Value = tbSoda
ElseIf combWeek = "4" Then
Range("b35").Value = tbLiq
Range("c35").Value = tbDraft
Range("d35").Value = tbBottle
Range("e35").Value = tbCan
Range("f35").Value = tbWine
Range("g35").Value = tbSoda
ElseIf combWeek = "5" Then
Range("b45").Value = tbLiq
Range("c45").Value = tbDraft
Range("d45").Value = tbBottle
Range("e45").Value = tbCanned
Range("f45").Value = tbWine
Range("g45").Value = tbSoda
ElseIf combWeek = "6" Then
Range("b55").Value = tbLiq
Range("c55").Value = tbDraft
Range("d55").Value = tbBottle
Range("e55").Value = tbCanned
Range("f55").Value = tbWine
Range("g55").Value = tbSoda

End If
End Sub
Private Sub UserForm_Initialize()

tbLiq.Value = "0.00"
tbDraft.Value = "0.00"
tbBottle.Value = "0.00"
tbCan.Value = "0.00"
tbWine.Value = "0.00"
tbSoda.Value = "0.00"

With combWeek
.AddItem "1"
.AddItem "2"
.AddItem "3"
.AddItem "4"
.AddItem "5"
.AddItem "6"
.AddItem "7"
.AddItem "8"
.AddItem "9"
.AddItem "10"
.AddItem "11"
End With
combWeek.Value = "1"
combWeek.SetFocus

End Sub


"Bob Phillips" wrote:

Show the code.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"harrar" wrote in message
...
Trying to set up a userform to enter weekly sales figures for various

items
i.e, bottles,cans, plastic with text boxes used for dollar amount

input
and
then dump the data into a the spreadsheet. The sheet cells are

formated
as
"currency" but when I run the userform the data is sent as text, the

cells
display i.e 2000 and an error message appears relating to format.

Tried to DIM the variables and .Value [currency] to no avail. All the
spreadsheet shows $0.00 irregardless of what was entered in the

userform.

I think the problem may be Property Set related but I'm not that

experienced
with it but then again it could be something really simple I'm

missing.

Any help provided would be greatly appreciated.

Thanks in advance






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default currency in vba userform

No, the problem is with every entry. It is sent from the form to the sheet
as text. Thanks for the Option Explicit though. I'll incorporate that now.

"Bob Phillips" wrote:

Is the problem with the Cans on week 5 & 6? You have a wrong textbox name
there, you use tbCanned where elsewhere you use tbCan.

If you used Option Explicit in your code, that would not be a problem.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"harrar" wrote in message
...
Sorry about that, Bob
Here's a sample of the coding for the userform:

Private Sub cmdCancel_Click()
Unload Me
End Sub

Private Sub cmdClear_Click()
Call UserForm_Initialize
End Sub

Private Sub cmdEnter_Click()
Sheet1.Select
If combWeek = "1" Then
Range("b6").Value = tbLiq
Range("c6").Value = tbDraft
Range("d6").Value = tbBottle
Range("e6").Value = tbCan
Range("f6").Value = tbWine
Range("g6").Value = tbSoda
ElseIf combWeek = "2" Then
Range("b15").Value = tbLiq
Range("c15").Value = tbDraft
Range("d15").Value = tbBottle
Range("e15").Value = tbCan
Range("f15").Value = tbWine
Range("g15").Value = tbSoda
ElseIf combWeek = "3" Then
Range("b25").Value = tbLiq
Range("c25").Value = tbDraft
Range("d25").Value = tbBottle
Range("e25").Value = tbCan
Range("f25").Value = tbWine
Range("g25").Value = tbSoda
ElseIf combWeek = "4" Then
Range("b35").Value = tbLiq
Range("c35").Value = tbDraft
Range("d35").Value = tbBottle
Range("e35").Value = tbCan
Range("f35").Value = tbWine
Range("g35").Value = tbSoda
ElseIf combWeek = "5" Then
Range("b45").Value = tbLiq
Range("c45").Value = tbDraft
Range("d45").Value = tbBottle
Range("e45").Value = tbCanned
Range("f45").Value = tbWine
Range("g45").Value = tbSoda
ElseIf combWeek = "6" Then
Range("b55").Value = tbLiq
Range("c55").Value = tbDraft
Range("d55").Value = tbBottle
Range("e55").Value = tbCanned
Range("f55").Value = tbWine
Range("g55").Value = tbSoda

End If
End Sub
Private Sub UserForm_Initialize()

tbLiq.Value = "0.00"
tbDraft.Value = "0.00"
tbBottle.Value = "0.00"
tbCan.Value = "0.00"
tbWine.Value = "0.00"
tbSoda.Value = "0.00"

With combWeek
.AddItem "1"
.AddItem "2"
.AddItem "3"
.AddItem "4"
.AddItem "5"
.AddItem "6"
.AddItem "7"
.AddItem "8"
.AddItem "9"
.AddItem "10"
.AddItem "11"
End With
combWeek.Value = "1"
combWeek.SetFocus

End Sub


"Bob Phillips" wrote:

Show the code.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"harrar" wrote in message
...
Trying to set up a userform to enter weekly sales figures for various
items
i.e, bottles,cans, plastic with text boxes used for dollar amount

input
and
then dump the data into a the spreadsheet. The sheet cells are

formated
as
"currency" but when I run the userform the data is sent as text, the

cells
display i.e 2000 and an error message appears relating to format.

Tried to DIM the variables and .Value [currency] to no avail. All the
spreadsheet shows $0.00 irregardless of what was entered in the

userform.

I think the problem may be Property Set related but I'm not that
experienced
with it but then again it could be something really simple I'm

missing.

Any help provided would be greatly appreciated.

Thanks in advance






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
Currency Format on UserForm when opened! Robo[_2_] Excel Discussion (Misc queries) 3 May 8th 07 02:42 PM
Currency Format for label in UserForm Allen Geddes Excel Programming 3 November 18th 05 06:30 PM
Formatting textbox currency on userform gki[_11_] Excel Programming 2 July 27th 04 01:30 PM
Currency in Userform Fixital Excel Programming 3 May 17th 04 08:37 PM
Textbox on a userform.. dispaly as currency John Wilson Excel Programming 0 September 10th 03 10:54 PM


All times are GMT +1. The time now is 11:56 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"