textbox.caption question

  • Thread starter Thread starter CG Rosén
  • Start date Start date
C

CG Rosén

Good Morning Group,

Have some problem with a presentation of values in a textbox.
The code below works fine and presents the values in a Textbox in UserForm1.
The Cells(1,1) is formated as 'number' with 2 decimals. When the value in
the cell is of the type xxxx,00 (the decimal values are zero) the Textbox
does not show this, but just xxxx. Is there a way to have the Textbox to
show these decimals even if they are zero?

Brgds

CG Rosén

n = Application.WorksheetFunction.Sum(Sheets(1).Range(Sheets(1).Cells(r, 1),
Sheets(1).Cells(r, 20)))

Worksheets(2).Cells(1, 1) = n

UserForm1.Label1.Caption = Round(Worksheets(2).Cells(1, 1), 2)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top