Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Problem with simple routine to change font size

Hi,

Could anyone help me. I'm struggling with the following two routines that
allow the user to change the font size.

Sub fontsize(size As Byte)
ActiveCell.Font.size = size
End Sub

Sub test()
a = InputBox("please enter fontsize")
Call fontsize(a)
End Sub

It gives me an error but I think it should work. Is this a bug?

Thanks

Suzie
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Problem with simple routine to change font size

I think I would have use Double.

Option Explicit
Sub fontsize(size As Double)
ActiveCell.Font.size = size
End Sub
Sub test()
Dim a As Double
a = InputBox("please enter fontsize")
Call fontsize(a)
End Sub

But your code worked ok in my simple tests.

What did you specify as a font size?

What happened when you tried it? What was the error?



Suzie wrote:

Hi,

Could anyone help me. I'm struggling with the following two routines that
allow the user to change the font size.

Sub fontsize(size As Byte)
ActiveCell.Font.size = size
End Sub

Sub test()
a = InputBox("please enter fontsize")
Call fontsize(a)
End Sub

It gives me an error but I think it should work. Is this a bug?

Thanks

Suzie


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Problem with simple routine to change font size

That works great, thanks very much

Suzie

"Dave Peterson" wrote:

I think I would have use Double.

Option Explicit
Sub fontsize(size As Double)
ActiveCell.Font.size = size
End Sub
Sub test()
Dim a As Double
a = InputBox("please enter fontsize")
Call fontsize(a)
End Sub

But your code worked ok in my simple tests.

What did you specify as a font size?

What happened when you tried it? What was the error?



Suzie wrote:

Hi,

Could anyone help me. I'm struggling with the following two routines that
allow the user to change the font size.

Sub fontsize(size As Byte)
ActiveCell.Font.size = size
End Sub

Sub test()
a = InputBox("please enter fontsize")
Call fontsize(a)
End Sub

It gives me an error but I think it should work. Is this a bug?

Thanks

Suzie


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change font size on screen, but prints in old size lvrcdval Excel Discussion (Misc queries) 2 July 19th 07 02:36 PM
change scaling % but font size didnt change porportionally, pls he Scaling question Excel Discussion (Misc queries) 0 March 12th 07 03:16 AM
Change all text one font size up with various font sizes used. omchrystal New Users to Excel 2 March 6th 07 09:01 PM
MsgBox Font Size change Robert Christie[_3_] Excel Programming 3 January 28th 05 01:51 PM
Change Font Size Steve Klenner Excel Worksheet Functions 2 November 14th 04 09:34 PM


All times are GMT +1. The time now is 11:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"