Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Format Help BOLD year in a specific vehicle application Column
Basically I am a mobile electronics installer. I have created an inventory of
what metra kits (www.metraonline.com) we have, where they are stored, and specific vehicle application. Now what I would like is the year to be bolded. It varies from line to line but most are like this "Hyndia Excel 86-89 Mitsubishi Precis 87-89" or "Mazda Multi Kit 86-95 Dash Bezel Mount" and "Honda Accord 03-Up" Is it possible to custom format this to diffientiate between the Make model, and the year? |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Format Help BOLD year in a specific vehicle application Column
Hi
You can do it manually by just highlighting the relevant characters in the formula bar and pressing the Bold icon. For a large list of cells, you would need to use some VBA code to achieve this. If you mark the range of cells on your sheet containing these entries, then run the code below, it should carry out the task for you. Sub BoldYear() Dim test As String, First As Integer, Last As Integer, i As Integer, Length As Integer Dim c As Range For Each c In Selection test = c.Value ' find first numeric For i = 1 To Len(test) If IsNumeric(Mid(test, i, 1)) Then First = i Exit For End If Next 'find last numeric For i = First + 1 To Len(test) If Mid(test, i, 1) < "-" Then If Not IsNumeric(Mid(test, i, 1)) Then Last = i Exit For End If End If Next If Last = 0 Then Last = i Length = Last - First ' now embolden from first to last characters With c.Characters(Start:=First, Length:=Length).Font .FontStyle = "Bold" End With First = 0: Last = 0: Length = 0 Next c End Sub You can copy the code and paste it into your Visual Basic Editor (VBE) in a Standard Module located in your file. To do this, Alt + F11 (open VBE) Ctrl + R (open Project Explorer) Select the file name on the left Insert Module Paste code in Module David McRitchie has lots of useful help on his site at http://www.mvps.org/dmcritchie/excel/install.htm http://www.mvps.org/dmcritchie/excel/getstarted.htm -- Regards Roger Govier "mobile electronics installer" <mobile electronics wrote in message ... Basically I am a mobile electronics installer. I have created an inventory of what metra kits (www.metraonline.com) we have, where they are stored, and specific vehicle application. Now what I would like is the year to be bolded. It varies from line to line but most are like this "Hyndia Excel 86-89 Mitsubishi Precis 87-89" or "Mazda Multi Kit 86-95 Dash Bezel Mount" and "Honda Accord 03-Up" Is it possible to custom format this to diffientiate between the Make model, and the year? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help with application of custom format to entire column | Excel Discussion (Misc queries) | |||
How can I sum only amounts that are in BOLD format within a column | New Users to Excel | |||
hyperlink an excel cell to a specific location wthin application f | New Users to Excel | |||
hyperlink an excel cell to a specific location wthin application f | Excel Discussion (Misc queries) | |||
Format an excel column as a date for a 5 day week for a year. | Excel Discussion (Misc queries) |