View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
moondark[_3_] moondark[_3_] is offline
external usenet poster
 
Posts: 1
Default Programming with symbols


Ok, first you've got to create a CommandButton to execute the VBA-Code.
Unfortunately I only know the german version of MS Excel so you'll hav
to search for it on your own. It's probably a window called "tools".
After adding the Commandbutton open the VBA Editor, pressing ALT+F11
Now paste the following code

Code
-------------------
Private Sub CommandButton1_Click()
If Cells(1, 1) = 12 Then
Cells(1, 3) = Cells(1, 4) 'transferring content

With Cells(1, 3).Font 'and format
.Name = Cells(1, 4).Font.Name
.Size = Cells(1, 4).Font.Size
.Strikethrough = Cells(1, 4).Font.Strikethrough
.Superscript = Cells(1, 4).Font.Superscript
.Subscript = Cells(1, 4).Font.Subscript
.OutlineFont = Cells(1, 4).Font.OutlineFont
.Shadow = Cells(1, 4).Font.Shadow
.Underline = Cells(1, 4).Font.Underline
.ColorIndex = Cells(1, 4).Font.ColorIndex
End With

End If
End Sub

-------------------

this code checks if Cell A1 has a value = 12
in case it's true, it transfers the value of cell D1 to C1 and al
values according to the font property such as font-family and size an
color a.s.o.
if A1 is <12 or empty it does nothing

Good luck searching the tools-window ;)

Simo

--
moondar
-----------------------------------------------------------------------
moondark's Profile: http://www.excelforum.com/member.php...fo&userid=2739
View this thread: http://www.excelforum.com/showthread.php?threadid=46985