Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a very large spreadsheet of some data that someone else entered.
They have separated groups in the sheet by using Bold text for the first line. I know this is a poor way of doing it but it is too late to change. It is OK when viewing the spreadsheet but I would like to transfer it to ACCESS because of its size. I would like to detect the lines with bold text so that I can add a flag in a new column to identify them. Is there any way of doing this? -- JMB |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
hi
assuming that all the text in each line is bold you might do a loop Sub test1() Dim rg As Range Dim rgd As Range Set rg = Cells(1, 1) Do While Not IsEmpty(rg) Set rgd = rg.Offset(1, 0) If rg.Font.Bold Then rg.end(xlright).offset(0,1).value = "Flag" End If Set rg = rgd Loop End Sub regards FSt1 "JMB" wrote: I have a very large spreadsheet of some data that someone else entered. They have separated groups in the sheet by using Bold text for the first line. I know this is a poor way of doing it but it is too late to change. It is OK when viewing the spreadsheet but I would like to transfer it to ACCESS because of its size. I would like to detect the lines with bold text so that I can add a flag in a new column to identify them. Is there any way of doing this? -- JMB |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks, getting a bit late so will have a play on a small test sheet tomorrow.
-- JMB "FSt1" wrote: hi assuming that all the text in each line is bold you might do a loop Sub test1() Dim rg As Range Dim rgd As Range Set rg = Cells(1, 1) Do While Not IsEmpty(rg) Set rgd = rg.Offset(1, 0) If rg.Font.Bold Then rg.end(xlright).offset(0,1).value = "Flag" End If Set rg = rgd Loop End Sub regards FSt1 "JMB" wrote: I have a very large spreadsheet of some data that someone else entered. They have separated groups in the sheet by using Bold text for the first line. I know this is a poor way of doing it but it is too late to change. It is OK when viewing the spreadsheet but I would like to transfer it to ACCESS because of its size. I would like to detect the lines with bold text so that I can add a flag in a new column to identify them. Is there any way of doing this? -- JMB |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If you know that the entire first line is bold, meaning you know the first
character is bold, guaranteed, then this User Defined Function will work for you... Function IsFirstLineBold(CellAddr As Range) As Boolean Application.Volatile IsFirstLineBold = CellAddr.Characters(1, 1).Font.Bold End Function If, on the other hand, the first line can "look" bold, but possibly have non-bolded leading blank spaces, then this more general function (it out if there is a bold character anywhere in the cell) would probably be what you want... Function IsAnythingBold(CellAddr As Range) As Boolean Dim X As Long Application.Volatile For X = 1 To Len(CellAddr.Value) If CellAddr.Characters(X, 1).Font.Bold Then IsAnythingBold = True Exit For End If Next End Function By the way, if you are not familiar with User Defined Function... you would go into the VBA editor, Insert a Module and then paste one of the functions above into its code window; then just put this... IsFirstLineBold(A1) <<<or =IsAnythingBold(A1) into B1 (use your own cell references in place of the A1 and B1). Rick "JMB" wrote in message ... I have a very large spreadsheet of some data that someone else entered. They have separated groups in the sheet by using Bold text for the first line. I know this is a poor way of doing it but it is too late to change. It is OK when viewing the spreadsheet but I would like to transfer it to ACCESS because of its size. I would like to detect the lines with bold text so that I can add a flag in a new column to identify them. Is there any way of doing this? -- JMB |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
un-Bold part of text in a cell (automatically) | Excel Discussion (Misc queries) | |||
Detecting text and returning a value | Excel Discussion (Misc queries) | |||
How do I get selected text within a cell to remain bold in excel? | Excel Discussion (Misc queries) | |||
Join bold and non-bold text in one cell | Excel Discussion (Misc queries) | |||
Detecting Case of Text in a Cell | Excel Discussion (Misc queries) |