![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Posts: 117
|
Hi-
Im trying to figure out a code that will list a format("$#,##0.00") in a list box upon activation. This is the code: Private Sub UserForm_Activate() Dim Lb1, x As Double x = 1 With Sheets("balance sheet") While Lb1 <> Int(Now) Lb1 = .Range("D1").Offset(x, 0) x = x + 1 Wend ListBox1.Clear ListBox1.AddItem .Range("D1").Offset(x - 1, 1).Value end with end sub If I dont format the listbox1.add item, I get 3.233333. What I want is the listbox1 to read is $3.23 when its activated. Any ideas? |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Portland, OR USA
Posts: 1,374
|
Try .Text instead of .Value
HTH, Russell |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|