I have code that is printing text into a given set of cells as shown below:
'SAMPLE
Sheets("Sheet1").Range("A11") = "B. TEST SAMPLES"
Sheets("Sheet1").Range("B12") = "SS"
Sheets("Sheet1").Range("C12") = "PART NO."
Sheets("Sheet1").Range("C12:H12").Merge
Sheets("Sheet1").Range("C12:H12").HorizontalAlignment = xlCenter
Sheets("Sheet1").Range("I12") = "VALVE CODE"
Sheets("Sheet1").Range("I12:M12").Merge
Sheets("Sheet1").Range("I12:M12").HorizontalAlignment = xlCenter
Sheets("Sheet1").Range("N12") = "TYPE"
Sheets("Sheet1").Range("N12:P12").Merge
Sheets("Sheet1").Range("N12:P12").HorizontalAlignment = xlCenter
Sheets("Sheet1").Range("Q12") = "TA/SEALED"
Sheets("Sheet1").Range("Q12:T12").Merge
Sheets("Sheet1").Range("Q12:T12").HorizontalAlignment = xlCenter
Sheets("Sheet1").Range("U12") = "Qt"
Sheets("Sheet1").Range("V12") = "Spring"
Sheets("Sheet1").Range("V12:X12").Merge
Sheets("Sheet1").Range("V12:X12").HorizontalAlignment = xlCenter
Sheets("Sheet1").Range("Y12") = "DESCRIPTION"
It does this perfectly, now I want to bold the top cells. I write the following code to achieve this:
'FORMATTING
Range("B12").Font.Bold = True
Range("C12").Font.Bold = True
Range("I12").Font.Bold = True
Range("N12").Font.Bold = True
Range("Q12").Font.Bold = True
Range("U12").Font.Bold = True
Range("V12").Font.Bold = True
Range("Y12").Font.Bold = True
I do not see anything wrong with this code, the syntax seems fine but the formatting is not changed. ie. The cells I want bolded remain unbolded.
Could anyone provide some insight on why this is happening and how it can possibly be fixed?
Sheets("Sheet1").from all of them?