ActiveCell.Offset(0, 9).FormulaR1C1 = ActiveCell.Offset(0, -2).Value
ActiveCell.Offset(0, 9).Font.Name = "Calibri"
ActiveCell.Offset(0, 9).Font.Size = 11
ActiveCell.Offset(0, 9).Font.Bold = True
ActiveCell.Offset(0, 9).HorizontalAlignment = xlCenter
I have several sections of code similar to that above. I refer to the cell each and every time. I'm sure it would be more efficient using a With Block(as I was reminded from today's post on speeding up spreadsheets - thanks!).
I have tried some variations, but cannot get the context exactly right because either it runs but does nothing, or I get errors.
I tried the obvious:
With ActiveCell.Offset(0, 9).FormulaR1C1 = ActiveCell.Offset(0, -2).Value
.Font.Name = "Calibri"
.Font.Size = 11
.Font.Bold = True
.HorizontalAlignment = xlCenter
End With
I won't bore you with all the others.
What am I doing wrong? No, not urgent since it does work just fine as is, but I have the "optimization bug" and would like to make it as efficient as I can.
Thanks so much,
Deb
ActiveCell.Offset(0, 9).Font.Name = "Calibri"
ActiveCell.Offset(0, 9).Font.Size = 11
ActiveCell.Offset(0, 9).Font.Bold = True
ActiveCell.Offset(0, 9).HorizontalAlignment = xlCenter
I have several sections of code similar to that above. I refer to the cell each and every time. I'm sure it would be more efficient using a With Block(as I was reminded from today's post on speeding up spreadsheets - thanks!).
I have tried some variations, but cannot get the context exactly right because either it runs but does nothing, or I get errors.
I tried the obvious:
With ActiveCell.Offset(0, 9).FormulaR1C1 = ActiveCell.Offset(0, -2).Value
.Font.Name = "Calibri"
.Font.Size = 11
.Font.Bold = True
.HorizontalAlignment = xlCenter
End With
I won't bore you with all the others.
What am I doing wrong? No, not urgent since it does work just fine as is, but I have the "optimization bug" and would like to make it as efficient as I can.
Thanks so much,
Deb