Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Greek Letters in Modules

Greek Letters in Modules

Greek Letters in Modules


I am looking for help on 2 issues and will appreciate any input.

1--I have a macro which results in displaying a mathematical expression(string) in a cell using some of the string and text functions. How can Greek symbols such as PI or PHI be included within the module functions so they end up in the final expressions? or can it be done at all?

2--How can a single module be protected or hidden by assigning a password.


RE: Greek Letters in Modules

For what application and what language are you refering to?


RE: Greek Letters in Modules

Hi FM1!
about your #1, try this macro.
It reads from cell B2 a circle diameter (e.g. B2 value= 1.5) and writes in B3 its area expliciting PI.
Also it writes in B5 a sentence using mixed Arial and GreekC font (of course you can specify a different one).

Hope it helps.


Sub GreekInCell()
    ActiveCell.FormulaR1C1 = Str(Range("B2").Value ^ 2) & "*p/4"
    N% = Len(Range("B3"))
    With ActiveCell.Characters(Start:=N% - 2, Length:=1).Font
             .Name = "GreekC"
             .FontStyle = "Regular"
    End With
    DD$ = "First letters of Greek alphabet are: ": U% = Len(DD$) + 1
    DD$ = DD$ + "a(alpha), ": D% = Len(DD$) + 1
    DD$ = DD$ + "b (beta), ": T% = Len(DD$) + 1
    DD$ = DD$ + "g (gamma)"
    ActiveCell.FormulaR1C1 = DD$
    With ActiveCell
        .Characters(Start:=U%, Length:=1).Font.Name = "GreekC"
        .Characters(Start:=D%, Length:=1).Font.Name = "GreekC"
        .Characters(Start:=T%, Length:=1).Font.Name = "GreekC"
    End With
End Sub

RE: Greek Letters in Modules

Thanks palusa .

RE: Greek Letters in Modules

You can get some symbols directly by holding down the Alt key and typing the 4 digit code for the symbol. This only works for symbols in the extended character set.
e.g type [Alt] + 0248 to get ΓΈ.
Check what's available in the character map.

RE: Greek Letters in Modules

answer for #2:

from within the vba module, select Tools - VBAProject Properties...

select the protection tab.

have fun and good luck!

RE: Greek Letters in Modules

Thanks very much sdz and pmover,

very helpful pointer. I cant however find an "Alt+..." keystroke for the greek letter "Pi". Am I missing it? It seems that only some of the characters have the "Alt+..." keystroke associated with them.
Thanks again

RE: Greek Letters in Modules

Also, when I select the character "Pi" from character map to copy it to the VBA module I end up with a question mark in the module when i click the past button.
Am I missing something?

RE: Greek Letters in Modules

Pi isn't available using the [Alt]+... method. Just use the variable name pi in VBA modules. To show it in a spreadsheet you need to choose the "Symbol" character set and you can apply this to individual letters within the text in a cell so that a mix of symbols and english letters can be displayed.

I'm not sure how you would do it if you want to generate text in a module for display in a sheet.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close