• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

MS Excel Custom Units

Hi,

Im trying to make my custom units variable depending upon a value in a cell.

for example if cell A1 contains "W" (Watts) cells A2:A5 have "W" as their units. If A1 has "mW" or "kW" then A2:A5 should have units "mW" or "kW" respectively.

thanks!
0
WTC_Services
Asked:
WTC_Services
  • 2
2 Solutions
 
StephenJRCommented:
With code you could something like this in the sheet module so will change every time A1 is changed:
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$A$1" Then Range("A2:A5").NumberFormat = "@" & Target

End Sub

Open in new window

0
 
WTC_ServicesAuthor Commented:
Thanks,

Do you know if there is any way to do this without code?

WTC
0
 
Rory ArchibaldCommented:
If you have Excel 2007 or later, you can apply number formats in conditional formatting, but you would have to create a rule for each format - you can't just have it append whatever is in A1.
0
 
WTC_ServicesAuthor Commented:
Thanks for the help guys!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now