SOLVED

Bolding Column A in a recorded macro does not work!

Copper Contributor

Hi, sorry a beginner here.

 

I recorded a macro to bold column A, but it bolds the entire page. How can I stop this please?

 

Thanks 

 

Sub Bold_A()
'
' Bold_A Macro
' Bold Column A
'

'
Columns("A:A").Select
Range("A2").Activate
Selection.Font.Bold = True
End Sub

4 Replies
best response confirmed by allyreckerman (Microsoft)
Solution

@Jonwithoutanh Try this:

 

Sub Bold_A()
    Columns("A:A").Font.Bold = True
End Sub

 

Perfect thank you! I will try to play around with other commands using the Columns ("A:A") thing. I think it is a bit strange that the recorded macro does not do this being an integral part of excel!

@Jonwithoutanh When you record a macro, every single key stroke and button you press gets recorded. Scroll the worksheet up or down and it will be recorded as well. Select one cell, then another and then do something with that selection. It's included as three different steps. Once the recording is done, you really need to get back into the code and clean it up. Get rid of the scrolling and buttons you (perhaps) clicked by mistake. And then you can also join the unnecessary ".Select" followed by "Selection." statements into one line of code, as in my example.

@Riny_van_Eekelen 

 

You know your stuff and thank you again. Lesson learned :) 

1 best response

Accepted Solutions
best response confirmed by allyreckerman (Microsoft)
Solution

@Jonwithoutanh Try this:

 

Sub Bold_A()
    Columns("A:A").Font.Bold = True
End Sub

 

View solution in original post