Fordraiders
asked on
function to enter formula in cells down a column based on cell color
excel 2003 vba
routine needed:
I have a "sheet1" with lookup data for sheet "UnSolicated_Projects".
On sheet "UnSolicated_Projects"
I have Gray rows as seperator
RGB(194, 194, 194)
On sheet "UnSolicated_Projects"
In ColumnB STARTING IN B2(but not always on B2) I need a formula inserted.
=VLOOKUP(A2,Sheet1!$A$2:$C O$11628,74 ,FALSE)
evertime there is a gray row , Underneath the gray cell THE formlua TO BE ADDED:
caveat:
Sometimes I may have 4 gray lines in a row
so the first row may be B5
=VLOOKUP(A5,Sheet1!$A$2:$C O$11628,74 ,FALSE)
Either way I need this formula added to ColumnB below a Grayline if the cell background is "NoFill"
Until the end of the rows.
The number of rows will always be different for each execution of the sub routine.
Then execute the formula
Thanks
fordraiders
FormulaCodeSS.png
routine needed:
I have a "sheet1" with lookup data for sheet "UnSolicated_Projects".
On sheet "UnSolicated_Projects"
I have Gray rows as seperator
RGB(194, 194, 194)
On sheet "UnSolicated_Projects"
In ColumnB STARTING IN B2(but not always on B2) I need a formula inserted.
=VLOOKUP(A2,Sheet1!$A$2:$C
evertime there is a gray row , Underneath the gray cell THE formlua TO BE ADDED:
caveat:
Sometimes I may have 4 gray lines in a row
so the first row may be B5
=VLOOKUP(A5,Sheet1!$A$2:$C
Either way I need this formula added to ColumnB below a Grayline if the cell background is "NoFill"
Until the end of the rows.
The number of rows will always be different for each execution of the sub routine.
Then execute the formula
Thanks
fordraiders
FormulaCodeSS.png
ASKER
Does column A always start with CRS for a total row? YES
Is the CRS name constant in column C? YES
But I need vba function...this needs to be automated via a sub routine...not manual please
Is the CRS name constant in column C? YES
But I need vba function...this needs to be automated via a sub routine...not manual please
Can I ask why it has to be vba if the formula is working?
The population of the formula down the column as the data expands could be automated if you wanted.
The population of the formula down the column as the data expands could be automated if you wanted.
ASKER
because my folks are using this sheet not me , and they do not do anything manual
ASKER
WITHOUT HAVING TO WORRY ABOUT THE COLOR ROW.
this almost works
Application.ScreenUpdating = False
Sheets("UnSolicated_Projec ts").Selec t
Dim LastRow As Long
LastRow = Cells.Find(What:="*", _
SearchDirection:=xlPreviou s, _
SearchOrder:=xlByRows).Row
Range("B2:B" & LastRow).FormulaR1C1 = "=VLOOKUP(R[ACTIVECELL.ROW ],Sheet1!$ A$2:$CO$11 628,74,FAL SE)"
Application.CutCopyMode = False
Application.ScreenUpdating = True
this almost works
Application.ScreenUpdating
Sheets("UnSolicated_Projec
Dim LastRow As Long
LastRow = Cells.Find(What:="*", _
SearchDirection:=xlPreviou
SearchOrder:=xlByRows).Row
Range("B2:B" & LastRow).FormulaR1C1 = "=VLOOKUP(R[ACTIVECELL.ROW
Application.CutCopyMode = False
Application.ScreenUpdating
ASKER
this works.
Application.ScreenUpdating = False
Sheets("UnSolicated_Projec ts").Selec t
Dim LastRow As Long
Dim j As Integer
j = ActiveCell.Row
LastRow = Cells.Find(What:="*", _
SearchDirection:=xlPreviou s, _
SearchOrder:=xlByRows).Row
Range("B2:B" & LastRow).Formula = "=VLOOKUP(A2,Sheet1!$A$2:$ CO$11628,7 4,FALSE)"
Application.CutCopyMode = False
Application.ScreenUpdating = True
Application.ScreenUpdating
Sheets("UnSolicated_Projec
Dim LastRow As Long
Dim j As Integer
j = ActiveCell.Row
LastRow = Cells.Find(What:="*", _
SearchDirection:=xlPreviou
SearchOrder:=xlByRows).Row
Range("B2:B" & LastRow).Formula = "=VLOOKUP(A2,Sheet1!$A$2:$
Application.CutCopyMode = False
Application.ScreenUpdating
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
Is the CRS name constant in column C?
If so you could an IF statement:
=IF(LEFT($A2,3)="CRS",SUMI
Copy down and then apply conditional formatting based on the CRS again for the total rows.
Thanks
Rob H