Font question

verluc

Well-known Member
Joined
Mar 1, 2002
Messages
1,451
I have a sheet who I want the column A make bold.See the following macro I wrote:
With Cells(10, 1).Font
.Name = "Arial"
.Size = 10
.FontStyle = "Bold"
End With

In this macro only the cell of row 10 change in bold.I want to have all the cells in column A change in bold,but I don't know in advance ho many rows there are.It is variable.

Anyone a solution on this.
Many thanks
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Is something like this any good to you?

<pre>
With ActiveSheet.UsedRange.Columns("A").Font
.Name = "Arial"
.Size = 10
.FontStyle = "Bold"
End With</pre>
 
Upvote 0
On 2002-04-22 13:53, Mark O'Brien wrote:
Is something like this any good to you?

<pre>
With ActiveSheet.UsedRange.Columns("A").Font
.Name = "Arial"
.Size = 10
.FontStyle = "Bold"
End With</pre>
Many thanks,that's what I need.
(Is there also a code so that all the text in cell are on the left in the cell?)
 
Upvote 0
Hi

Text ie JACK in left or should be right is value and numbers, so you need to convert to text the whole column in this case..

Simple is add col and convert then CPAV (copy / paste as value) silly but will left align im sure.

=text(cell, 0 )
then CPAV

Caution XP will not like this and all sorts will pop up even green triangles. XP is winding me up!
 
Upvote 0
On 2002-04-22 14:03, Jack in the UK wrote:
Hi

Text ie JACK in left or should be right is value and numbers, so you need to convert to text the whole column in this case..

Simple is add col and convert then CPAV (copy / paste as value) silly but will left align im sure.

=text(cell, 0 )
then CPAV

Caution XP will not like this and all sorts will pop up even green triangles. XP is winding me up!



I mean the code in VBA to add at my macro,so that all the text in column A is on the left side and not central or right of the cell.
Thanks for this adding code.
 
Upvote 0
verluc,

You mean something like this?

<pre>
With ActiveSheet.UsedRange.Columns("A")
With .Font
.Name = "Arial"
.Size = 10
.FontStyle = "Bold"
End With
.HorizontalAlignment = xlLeft
End With</pre>

HTH
 
Upvote 0
On 2002-04-22 14:28, Mark O'Brien wrote:
verluc,

You mean something like this?

<pre>
With ActiveSheet.UsedRange.Columns("A")
With .Font
.Name = "Arial"
.Size = 10
.FontStyle = "Bold"
End With
.HorizontalAlignment = xlLeft
End With</pre>

HTH
Sorry Mark,but I get an error on this.
Can you see it?
Thanks
 
Upvote 0
It looks like the problem is that you have 2
"End With" , remove 1 and it should be fine

James
 
Upvote 0
On 2002-04-22 14:42, James wrote:
It looks like the problem is that you have 2
"End With" , remove 1 and it should be fine

James
James,I have removed the first "End With" and I get still the same error.
 
Upvote 0
Sorry, i didn't realize the 2nd "End With"
should have been End Sub, just type End Sub
as the last line in the code

James
 
Upvote 0

Forum statistics

Threads
1,213,560
Messages
6,114,304
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top