Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The set up looks like this:
ColU ColV ColW ColX Y N N N Y N N N N Y N N N N Y N N N Y N N N Y N N N Y N N N Y Y Columns will always be U through X and will always be sorted in this order. I need to find the first Y in each column and insert 2 rows above that row. On the blank row above the first Y, I need to highlight in yellow and put title in the first cell, such as New, Old, Existing, Deleted. Any help would be greatly appreciated. Thanks for your time, Dee |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet 2. You give me the newsgroup and the subject line 3. You send a clear explanation of what you want 4. You send before/after examples and expected results. -- Don Guillett Microsoft MVP Excel SalesAid Software "Dee Sperling" wrote in message ... The set up looks like this: ColU ColV ColW ColX Y N N N Y N N N N Y N N N N Y N N N Y N N N Y N N N Y N N N Y Y Columns will always be U through X and will always be sorted in this order. I need to find the first Y in each column and insert 2 rows above that row. On the blank row above the first Y, I need to highlight in yellow and put title in the first cell, such as New, Old, Existing, Deleted. Any help would be greatly appreciated. Thanks for your time, Dee |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You didn't specify the "rules" for what titles to use, so this routine does
what you asked byt just puts the word "Title" in the yellow cell: Sub InsertY() For col = 21 To 24 rw = Columns(col).Find("Y").Row Cells(rw, col).Resize(2).Insert shift:=xlDown Cells(rw + 1, col).Interior.Color = vbYellow Cells(rw + 1, col).Value = "Title" Next End Sub Bob Umlas Excel MVP "Dee Sperling" wrote: The set up looks like this: ColU ColV ColW ColX Y N N N Y N N N N Y N N N N Y N N N Y N N N Y N N N Y N N N Y Y Columns will always be U through X and will always be sorted in this order. I need to find the first Y in each column and insert 2 rows above that row. On the blank row above the first Y, I need to highlight in yellow and put title in the first cell, such as New, Old, Existing, Deleted. Any help would be greatly appreciated. Thanks for your time, Dee |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The titles will be New, Old, Existing, Deleted in that order from U to X.
Sorry I didn't make that clearer. I put the code in my module but I get Run-time errro '91": Opject variable or With block variable not set I'm using Excel 2003, is that the cause? "Bob Umlas, Excel MVP" wrote: You didn't specify the "rules" for what titles to use, so this routine does what you asked byt just puts the word "Title" in the yellow cell: Sub InsertY() For col = 21 To 24 rw = Columns(col).Find("Y").Row Cells(rw, col).Resize(2).Insert shift:=xlDown Cells(rw + 1, col).Interior.Color = vbYellow Cells(rw + 1, col).Value = "Title" Next End Sub Bob Umlas Excel MVP "Dee Sperling" wrote: The set up looks like this: ColU ColV ColW ColX Y N N N Y N N N N Y N N N N Y N N N Y N N N Y N N N Y N N N Y Y Columns will always be U through X and will always be sorted in this order. I need to find the first Y in each column and insert 2 rows above that row. On the blank row above the first Y, I need to highlight in yellow and put title in the first cell, such as New, Old, Existing, Deleted. Any help would be greatly appreciated. Thanks for your time, Dee |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It would probably help if I specified which line it stops on:
rw = Columns(col).Find("Y").Row "Dee Sperling" wrote: The titles will be New, Old, Existing, Deleted in that order from U to X. Sorry I didn't make that clearer. I put the code in my module but I get Run-time errro '91": Opject variable or With block variable not set I'm using Excel 2003, is that the cause? "Bob Umlas, Excel MVP" wrote: You didn't specify the "rules" for what titles to use, so this routine does what you asked byt just puts the word "Title" in the yellow cell: Sub InsertY() For col = 21 To 24 rw = Columns(col).Find("Y").Row Cells(rw, col).Resize(2).Insert shift:=xlDown Cells(rw + 1, col).Interior.Color = vbYellow Cells(rw + 1, col).Value = "Title" Next End Sub Bob Umlas Excel MVP "Dee Sperling" wrote: The set up looks like this: ColU ColV ColW ColX Y N N N Y N N N N Y N N N N Y N N N Y N N N Y N N N Y N N N Y Y Columns will always be U through X and will always be sorted in this order. I need to find the first Y in each column and insert 2 rows above that row. On the blank row above the first Y, I need to highlight in yellow and put title in the first cell, such as New, Old, Existing, Deleted. Any help would be greatly appreciated. Thanks for your time, Dee |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
As structured, the code expects you to have the worksheet with your Y's and
N's as the active worksheet. Go back and select that worksheet and then try running the code again. -- Rick (MVP - Excel) "Dee Sperling" wrote in message ... It would probably help if I specified which line it stops on: rw = Columns(col).Find("Y").Row "Dee Sperling" wrote: The titles will be New, Old, Existing, Deleted in that order from U to X. Sorry I didn't make that clearer. I put the code in my module but I get Run-time errro '91": Opject variable or With block variable not set I'm using Excel 2003, is that the cause? "Bob Umlas, Excel MVP" wrote: You didn't specify the "rules" for what titles to use, so this routine does what you asked byt just puts the word "Title" in the yellow cell: Sub InsertY() For col = 21 To 24 rw = Columns(col).Find("Y").Row Cells(rw, col).Resize(2).Insert shift:=xlDown Cells(rw + 1, col).Interior.Color = vbYellow Cells(rw + 1, col).Value = "Title" Next End Sub Bob Umlas Excel MVP "Dee Sperling" wrote: The set up looks like this: ColU ColV ColW ColX Y N N N Y N N N N Y N N N N Y N N N Y N N N Y N N N Y N N N Y Y Columns will always be U through X and will always be sorted in this order. I need to find the first Y in each column and insert 2 rows above that row. On the blank row above the first Y, I need to highlight in yellow and put title in the first cell, such as New, Old, Existing, Deleted. Any help would be greatly appreciated. Thanks for your time, Dee |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It is running on the active sheet, it goes once and inserts a cell rather
than a row, then stops with the error. The result in the spreadsheet looks like this: New Old Existing Deleted N N N Title N N N Y N N N Y N N N Y N N N N Y N N N N Y N N N N Y N N N Y "Rick Rothstein" wrote: As structured, the code expects you to have the worksheet with your Y's and N's as the active worksheet. Go back and select that worksheet and then try running the code again. -- Rick (MVP - Excel) "Dee Sperling" wrote in message ... It would probably help if I specified which line it stops on: rw = Columns(col).Find("Y").Row "Dee Sperling" wrote: The titles will be New, Old, Existing, Deleted in that order from U to X. Sorry I didn't make that clearer. I put the code in my module but I get Run-time errro '91": Opject variable or With block variable not set I'm using Excel 2003, is that the cause? "Bob Umlas, Excel MVP" wrote: You didn't specify the "rules" for what titles to use, so this routine does what you asked byt just puts the word "Title" in the yellow cell: Sub InsertY() For col = 21 To 24 rw = Columns(col).Find("Y").Row Cells(rw, col).Resize(2).Insert shift:=xlDown Cells(rw + 1, col).Interior.Color = vbYellow Cells(rw + 1, col).Value = "Title" Next End Sub Bob Umlas Excel MVP "Dee Sperling" wrote: The set up looks like this: ColU ColV ColW ColX Y N N N Y N N N N Y N N N N Y N N N Y N N N Y N N N Y N N N Y Y Columns will always be U through X and will always be sorted in this order. I need to find the first Y in each column and insert 2 rows above that row. On the blank row above the first Y, I need to highlight in yellow and put title in the first cell, such as New, Old, Existing, Deleted. Any help would be greatly appreciated. Thanks for your time, Dee . |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Would help if I said what line it stops on:
rw = Columns(col).Find("Y").Row "Bob Umlas, Excel MVP" wrote: You didn't specify the "rules" for what titles to use, so this routine does what you asked byt just puts the word "Title" in the yellow cell: Sub InsertY() For col = 21 To 24 rw = Columns(col).Find("Y").Row Cells(rw, col).Resize(2).Insert shift:=xlDown Cells(rw + 1, col).Interior.Color = vbYellow Cells(rw + 1, col).Value = "Title" Next End Sub Bob Umlas Excel MVP "Dee Sperling" wrote: The set up looks like this: ColU ColV ColW ColX Y N N N Y N N N N Y N N N N Y N N N Y N N N Y N N N Y N N N Y Y Columns will always be U through X and will always be sorted in this order. I need to find the first Y in each column and insert 2 rows above that row. On the blank row above the first Y, I need to highlight in yellow and put title in the first cell, such as New, Old, Existing, Deleted. Any help would be greatly appreciated. Thanks for your time, Dee |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
insert rows and copying cells in column b,c, and d into new rows | Excel Programming | |||
FInd value and insert rows below | Excel Programming | |||
find number & insert rows | Excel Programming | |||
Need Macro to Find Column Heading -- if none, then insert new column | Excel Programming | |||
find row value, insert column | Excel Programming |