Hello Experts,
Please help me to edit special characters and superscripts while making a drop down list:
Data --> Data Validation --> List -->(Deg Centigrade, meter Cube)
Thanks and best regards
Vilas Desai
Include superscripts and Special character in Data Validations
-
- 3StarLounger
- Posts: 307
- Joined: 16 Mar 2011, 09:33
-
- Administrator
- Posts: 78412
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Include superscripts and Special character in Data Validations
To do that, you must create the source list in a range of cells. See the attached example.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- 3StarLounger
- Posts: 307
- Joined: 16 Mar 2011, 09:33
Re: Include superscripts and Special character in Data Validations
Thanks as always, Hans. I want to avoid using the source list Can the macros do this?
-
- Administrator
- Posts: 78412
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Include superscripts and Special character in Data Validations
A source range is much more convenient, but of course you can also use something like
This may fail if you use Unicode characters, because the Visual Basic Editor does not fully support Unicode in the code itself.
Code: Select all
Sub SetDV()
With Range("A1").Validation
.Delete
.Add Type:=xlValidateList, Formula1:="°C,m²,cm³"
.ErrorTitle = "Boo!"
.ErrorMessage = "Wrong, wrong, wrong!"
End With
End Sub
Best wishes,
Hans
Hans
-
- 3StarLounger
- Posts: 307
- Joined: 16 Mar 2011, 09:33
Re: Include superscripts and Special character in Data Validations
Hans, how did you manage to edit the superscripts in the VBA editor? If I need to add another one like 2 raise to a or 3 power 4 how do i do it?
-
- Administrator
- Posts: 78412
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Include superscripts and Special character in Data Validations
I used Character Map from Start > Windows Accessories to find the characters and copy them to the clipboard. Then I pasted them.
This will work for the degree symbol and for superscript 2 and 3 - they belong to the "standard" character set.
But it won't work for superscript 4, 5, etc. - those are Unicode characters that will be changed to ? in the Visual Basic Editor.
That's why it is better to use a cell range to store the list.
This will work for the degree symbol and for superscript 2 and 3 - they belong to the "standard" character set.
But it won't work for superscript 4, 5, etc. - those are Unicode characters that will be changed to ? in the Visual Basic Editor.
That's why it is better to use a cell range to store the list.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- 3StarLounger
- Posts: 307
- Joined: 16 Mar 2011, 09:33
Re: Include superscripts and Special character in Data Validations
Perfect. You are amazing. Thanks a lot