Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have exported a task list from Project. Column C contains task names.
Summary tasks are bold and actual (working) tasks are not. I would like to (until there isn't any more data in Column C) insert a row after each task that is not a summary task (ie, not bold). I found other examples of inserting rows, but I don't know how to check this specific cell/text formatting. Any help is greatly appreciated. -------------- Justin |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try something like the following:
Dim RowNdx As Long Dim LastRow As Long LastRow = Cells(Rows.Count, "C").End(xlUp).Row For RowNdx = LastRow To 1 Step -1 If Cells(RowNdx, "C").Font.Bold = False Then Rows(RowNdx + 1).Insert End If Next RowNdx -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "WhyIsEverythingSoConfusing" wrote in message ... I have exported a task list from Project. Column C contains task names. Summary tasks are bold and actual (working) tasks are not. I would like to (until there isn't any more data in Column C) insert a row after each task that is not a summary task (ie, not bold). I found other examples of inserting rows, but I don't know how to check this specific cell/text formatting. Any help is greatly appreciated. -------------- Justin |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Works like a champ, thanks!
One little issue, though. All of my cells have borders. Rows inserted in the middle of the document maintain these borders. The last inserted row doesn't, however. Is there a quick way to ensure that this last row has the same formatting as the rest of the rows? -------------- Justin "Chip Pearson" wrote: Try something like the following: Dim RowNdx As Long Dim LastRow As Long LastRow = Cells(Rows.Count, "C").End(xlUp).Row For RowNdx = LastRow To 1 Step -1 If Cells(RowNdx, "C").Font.Bold = False Then Rows(RowNdx + 1).Insert End If Next RowNdx -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "WhyIsEverythingSoConfusing" wrote in message ... I have exported a task list from Project. Column C contains task names. Summary tasks are bold and actual (working) tasks are not. I would like to (until there isn't any more data in Column C) insert a row after each task that is not a summary task (ie, not bold). I found other examples of inserting rows, but I don't know how to check this specific cell/text formatting. Any help is greatly appreciated. -------------- Justin |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The borders are retained for all cells when I run the code.
-- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "WhyIsEverythingSoConfusing" wrote in message ... Works like a champ, thanks! One little issue, though. All of my cells have borders. Rows inserted in the middle of the document maintain these borders. The last inserted row doesn't, however. Is there a quick way to ensure that this last row has the same formatting as the rest of the rows? -------------- Justin "Chip Pearson" wrote: Try something like the following: Dim RowNdx As Long Dim LastRow As Long LastRow = Cells(Rows.Count, "C").End(xlUp).Row For RowNdx = LastRow To 1 Step -1 If Cells(RowNdx, "C").Font.Bold = False Then Rows(RowNdx + 1).Insert End If Next RowNdx -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "WhyIsEverythingSoConfusing" wrote in message ... I have exported a task list from Project. Column C contains task names. Summary tasks are bold and actual (working) tasks are not. I would like to (until there isn't any more data in Column C) insert a row after each task that is not a summary task (ie, not bold). I found other examples of inserting rows, but I don't know how to check this specific cell/text formatting. Any help is greatly appreciated. -------------- Justin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional formatting - check for blank cell | Excel Discussion (Misc queries) | |||
suppress conditional formatting programmatically | Excel Discussion (Misc queries) | |||
Check if Conditional Format is True or False / Check cell Color | Excel Worksheet Functions | |||
How to programmatically check if a workbook is protected t? | Excel Programming | |||
How to check programmatically whether Excel is installed on computer? | Excel Programming |