SOLVED

Bolding Column A in a recorded macro does not work!

%3CLINGO-SUB%20id%3D%22lingo-sub-2465119%22%20slang%3D%22en-US%22%3EBolding%20Column%20A%20in%20a%20recorded%20macro%20does%20not%20work!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2465119%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20sorry%20a%20beginner%20here.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20recorded%20a%20macro%20to%20bold%20column%20A%2C%20but%20it%20bolds%20the%20entire%20page.%20How%20can%20I%20stop%20this%20please%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESub%20Bold_A()%3CBR%20%2F%3E'%3CBR%20%2F%3E'%20Bold_A%20Macro%3CBR%20%2F%3E'%20Bold%20Column%20A%3CBR%20%2F%3E'%3C%2FP%3E%3CP%3E'%3CBR%20%2F%3EColumns(%22A%3AA%22).Select%3CBR%20%2F%3ERange(%22A2%22).Activate%3CBR%20%2F%3ESelection.Font.Bold%20%3D%20True%3CBR%20%2F%3EEnd%20Sub%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2465119%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2465122%22%20slang%3D%22en-US%22%3ERe%3A%20Bolding%20Column%20A%20in%20a%20recorded%20macro%20does%20not%20work!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2465122%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1083347%22%20target%3D%22_blank%22%3E%40Jonwithoutanh%3C%2FA%3E%26nbsp%3BTry%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-visual%22%3E%3CCODE%3ESub%20Bold_A()%0A%20%20%20%20Columns(%22A%3AA%22).Font.Bold%20%3D%20True%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New 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