I have search for 2 days only to find complex solutions. What i want to do is simpler. I have a current working VBA sub that selects a formula from one cell, named ("StockPriceFormula") and copy/pastes down a named range ("CurrStockPrcRange").
Current Working VBA:
=====================
Sub UpdateAllQuotes()
Range("StockPriceFormula").Select
Selection.Copy
Application.Goto Reference:="CurrStockPrcRange"
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub
=====================
What I want to add to that code is to SKIP pasting the formula to cells correspond to a value of the letter "C" in an adjacent Named Range. i.e. Range("StatusRange) <> "C"
What I want to add to the above VBA:
=====================
Sub UpdateAllQuotes()
Range("").Select
Selection.Copy
Application.Goto Reference:="CurrStockPrcRange"
'(ADD VBA code/Loop here to ONLY Paste if adjacent cell in Range("StatusRange") does
NOT have the letter "C" in it)
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub
=====================
I want to use "Named Ranges" not Column/Cell Letters/Numbers because the size and location of ranges changes depending on how my items are in the worksheet.
Example Worksheet:
<tbody>
</tbody>
Current Working VBA:
=====================
Sub UpdateAllQuotes()
Range("StockPriceFormula").Select
Selection.Copy
Application.Goto Reference:="CurrStockPrcRange"
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub
=====================
What I want to add to that code is to SKIP pasting the formula to cells correspond to a value of the letter "C" in an adjacent Named Range. i.e. Range("StatusRange) <> "C"
What I want to add to the above VBA:
=====================
Sub UpdateAllQuotes()
Range("").Select
Selection.Copy
Application.Goto Reference:="CurrStockPrcRange"
'(ADD VBA code/Loop here to ONLY Paste if adjacent cell in Range("StatusRange") does
NOT have the letter "C" in it)
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub
=====================
I want to use "Named Ranges" not Column/Cell Letters/Numbers because the size and location of ranges changes depending on how my items are in the worksheet.
Example Worksheet:
A CurrStocPrcRange | B SYMBOL | C Status |
skip this cell | XYZ | C |
36.95 | ABC | O |
skip this cell | DFG | C |
43.50 | UV | O |
<tbody>
</tbody>