(Simple) Showing Labels in UserForm as percentage format

Floyds_Of_London

New Member
Joined
May 29, 2021
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
I created a userform that displays certain values within row of the active cell, as a quick reference in a lofty spreadsheet. Right now it shows all values as regular numbers (shows "1" instead of "100%"), even if the referenced cell is a percentage. Code below --- i want Label9 to show up as a percentage.

Private Sub UserForm_Activate()


Label6.Caption = Range("F" & (ActiveCell.Row)).Value
Label7.Caption = Range("G" & (ActiveCell.Row)).Value
Label8.Caption = Range("H" & (ActiveCell.Row)).Value
Label9.Caption = Range("I" & (ActiveCell.Row)).Value

End Sub
 

Attachments

  • Capture.JPG
    Capture.JPG
    15.7 KB · Views: 5

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Marc L

Well-known Member
Joined
Apr 5, 2021
Messages
1,543
Office Version
  1. 2010
Platform
  1. Windows
Your bad 'cause you use the Value property instead of the cell layout via its Text property …​
 

Marc L

Well-known Member
Joined
Apr 5, 2021
Messages
1,543
Office Version
  1. 2010
Platform
  1. Windows
Which cell property do you use in your code ?​
 

Floyds_Of_London

New Member
Joined
May 29, 2021
Messages
3
Office Version
  1. 2016
Platform
  1. Windows

ADVERTISEMENT

Which cell property do you use in your code ?​
I don't even know how to answer that - I am extremely green here. Pretend i'm from a different planet
 

Marc L

Well-known Member
Joined
Apr 5, 2021
Messages
1,543
Office Version
  1. 2010
Platform
  1. Windows

As « solution belongs to good enough readers » so why using Value in your code instead of Text property ? …​
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,912
Office Version
  1. 2013
Platform
  1. Windows
I think he wants your code to look like this:
Label6.Caption = Range("F" & (ActiveCell.Row)).Text
 

Forum statistics

Threads
1,143,637
Messages
5,719,968
Members
422,252
Latest member
wannabegeek1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top