Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi All, I have just started using VBA so this might be an easy question but have been unable to find an answer so far in my searches. I have created a text box and added text to it, even changed th background colour all using VBA code. However I am unable to chang the font bold, text size, and alignment using VBA code for the tex box. Can anyone help? Also another question off the main topic, does anyone know how to tur the "snap to grid" option on and off using VBA code in excel? I am using Excel 97, its on a work computer and they have not upgrade yet. Any information would be greatly appreciated. Thank you and hace a nice day. Shane -- Shane ----------------------------------------------------------------------- Shane B's Profile: http://www.excelforum.com/member.php...fo&userid=1646 View this thread: http://www.excelforum.com/showthread.php?threadid=27820 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In a textbox from the control toolbox toolbar, you don't - it isn't
supported. A textbox from the Forms toolbar, use the characters method. For both questions, turn on the macro recorder and do it manually. Then stop the recorder and look at the recorded code. This will give you great insight into how to do it with VBA code. -- Regards, Tom Ogilvy "Shane B" wrote in message ... Hi All, I have just started using VBA so this might be an easy question but I have been unable to find an answer so far in my searches. I have created a text box and added text to it, even changed the background colour all using VBA code. However I am unable to change the font bold, text size, and alignment using VBA code for the text box. Can anyone help? Also another question off the main topic, does anyone know how to turn the "snap to grid" option on and off using VBA code in excel? I am using Excel 97, its on a work computer and they have not upgraded yet. Any information would be greatly appreciated. Thank you and hace a nice day. Shane B -- Shane B ------------------------------------------------------------------------ Shane B's Profile: http://www.excelforum.com/member.php...o&userid=16467 View this thread: http://www.excelforum.com/showthread...hreadid=278207 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Let me qualify my answer a little - I assumed you were doing Rich Text
Formats, but after rereading, that is not necessarily a valid assumption. For a control toolbox toolbar textbox you can do: Sub Macro3() ActiveSheet.TextBox2.Font.Bold = False ActiveSheet.TextBox2.Font.Size = 13 End Sub for bold and size. for alignment, I don't think it is supported. -- Regards, Tom Ogilvy "Tom Ogilvy" wrote in message ... In a textbox from the control toolbox toolbar, you don't - it isn't supported. A textbox from the Forms toolbar, use the characters method. For both questions, turn on the macro recorder and do it manually. Then stop the recorder and look at the recorded code. This will give you great insight into how to do it with VBA code. -- Regards, Tom Ogilvy "Shane B" wrote in message ... Hi All, I have just started using VBA so this might be an easy question but I have been unable to find an answer so far in my searches. I have created a text box and added text to it, even changed the background colour all using VBA code. However I am unable to change the font bold, text size, and alignment using VBA code for the text box. Can anyone help? Also another question off the main topic, does anyone know how to turn the "snap to grid" option on and off using VBA code in excel? I am using Excel 97, its on a work computer and they have not upgraded yet. Any information would be greatly appreciated. Thank you and hace a nice day. Shane B -- Shane B ------------------------------------------------------------------------ Shane B's Profile: http://www.excelforum.com/member.php...o&userid=16467 View this thread: http://www.excelforum.com/showthread...hreadid=278207 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I did this on record new macro. Range("A1").Select With Selection.Font .Name = "Arial" .FontStyle = "Bold" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With -----Original Message----- Hi All, I have just started using VBA so this might be an easy question but I have been unable to find an answer so far in my searches. I have created a text box and added text to it, even changed the background colour all using VBA code. However I am unable to change the font bold, text size, and alignment using VBA code for the text box. Can anyone help? Also another question off the main topic, does anyone know how to turn the "snap to grid" option on and off using VBA code in excel? I am using Excel 97, its on a work computer and they have not upgraded yet. Any information would be greatly appreciated. Thank you and hace a nice day. Shane B -- Shane B ---------------------------------------------------------- -------------- Shane B's Profile: http://www.excelforum.com/member.php? action=getinfo&userid=16467 View this thread: http://www.excelforum.com/showthread...hreadid=278207 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Text format - setting text colour with code | Excel Discussion (Misc queries) | |||
using a conditional suffix in text function format syntax=text(value,format_text) | Excel Worksheet Functions | |||
remove text with format code for phone numbers | Excel Discussion (Misc queries) | |||
Macro - Fixed text code needs replacing with variable text | Excel Discussion (Misc queries) | |||
code to convert date from TEXT format (03-02) to DATE format (200203) | Excel Programming |