Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Vba and excel, userform help

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default Vba and excel, userform help

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Vba and excel, userform help

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
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
VBA with userform in excel [email protected] Excel Discussion (Misc queries) 5 July 11th 07 11:24 PM
Userform in excel ST Excel Discussion (Misc queries) 2 July 13th 06 10:16 AM
Linking userform to userform in Excel 2003 missmelis01 Excel Programming 2 August 27th 04 08:07 PM
Userform & Excel window D.S.[_3_] Excel Programming 3 November 17th 03 11:41 PM
EXCEL USERFORM Dick Kusleika Excel Programming 3 August 4th 03 08:43 PM


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