Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi you all ,
here again with my stupid questions.... I have a workbook xxxx.xls and there is only one sheet with currency data. In cell A99 is a sum from column A. What is the best way to show it in Userform and how do I add there some text when the sum is negative? Hope I explained it clearly enough... |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jippo
Put this together in a userform's initialize event. The value is in A99 of a sheet called Sheet1 and it displays in a label called label1 on a userform. (It doesn't matter what the user form is called as it is in the userforms code module so I can simply use the keyword me Private Sub UserForm_Initialize() Dim dTotal As Double Dim sText As String dTotal = Worksheets("Sheet1").Range("A99").Value If dTotal < 0 Then sText = "Value in A99 is minus " & dTotal If dTotal = 0 Then sText = "Value is A99 is " & dTotal Me.Label1.Caption = sText End Sub -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England HIS "Jippo" wrote in message ... Hi you all , here again with my stupid questions.... I have a workbook xxxx.xls and there is only one sheet with currency data. In cell A99 is a sum from column A. What is the best way to show it in Userform and how do I add there some text when the sum is negative? Hope I explained it clearly enough... |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks!!!!!!
Saved My day! Here's a virtual beer for your your trouble [ ] -jippo- "Nick Hodge" wrote in message ... Jippo Put this together in a userform's initialize event. The value is in A99 of a sheet called Sheet1 and it displays in a label called label1 on a userform. (It doesn't matter what the user form is called as it is in the userforms code module so I can simply use the keyword me Private Sub UserForm_Initialize() Dim dTotal As Double Dim sText As String dTotal = Worksheets("Sheet1").Range("A99").Value If dTotal < 0 Then sText = "Value in A99 is minus " & dTotal If dTotal = 0 Then sText = "Value is A99 is " & dTotal Me.Label1.Caption = sText End Sub -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England HIS "Jippo" wrote in message ... Hi you all , here again with my stupid questions.... I have a workbook xxxx.xls and there is only one sheet with currency data. In cell A99 is a sum from column A. What is the best way to show it in Userform and how do I add there some text when the sum is negative? Hope I explained it clearly enough... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA with userform in excel | Excel Discussion (Misc queries) | |||
Userform in excel | Excel Discussion (Misc queries) | |||
Linking userform to userform in Excel 2003 | Excel Programming | |||
Userform & Excel window | Excel Programming | |||
EXCEL USERFORM | Excel Programming |