Formatting within a range of cells after a line break
Budget: $10 – $11 USD
Deliverables
VBA code that formats cells based on description in "additional information"
Additional Information
I have a drop down list of all the items on my menu that pulls info from another sheet. The formatting of the dish name does not transfer over once selected from dropdown. Basically, the dish name is in bold and the dish description is not. The dish name & dish description are separated by a line break.
I have VBA code that correctly re-formats the text, but it is only for a single cell. I can't figure out how to make it for a range, say "B27:B55"
here is the code:
Public Sub FormatDishFont_TEST()
Dim rngCell As Range
Dim lngPos As Long
Set rngCell = ActiveSheet.Range("B27")
lngPos = InStr(1, rngCell.Value, vbLf, vbBinaryCompare)
rngCell.Characters(1, lngPos).Font.Bold = False
With rngCell.Characters(lngPos + 1, Len(rngCell.Value) - lngPos)
.Font.Name = "CopperPlate Gothic Light"
.Font.Underline = False
.Font.Bold = False
End With
End Sub
Thank you so much!!
VBA code that formats cells based on description in "additional information"
Additional Information
I have a drop down list of all the items on my menu that pulls info from another sheet. The formatting of the dish name does not transfer over once selected from dropdown. Basically, the dish name is in bold and the dish description is not. The dish name & dish description are separated by a line break.
I have VBA code that correctly re-formats the text, but it is only for a single cell. I can't figure out how to make it for a range, say "B27:B55"
here is the code:
Public Sub FormatDishFont_TEST()
Dim rngCell As Range
Dim lngPos As Long
Set rngCell = ActiveSheet.Range("B27")
lngPos = InStr(1, rngCell.Value, vbLf, vbBinaryCompare)
rngCell.Characters(1, lngPos).Font.Bold = False
With rngCell.Characters(lngPos + 1, Len(rngCell.Value) - lngPos)
.Font.Name = "CopperPlate Gothic Light"
.Font.Underline = False
.Font.Bold = False
End With
End Sub
Thank you so much!!