ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Target Macro (https://www.excelbanter.com/excel-programming/426409-target-macro.html)

MCheru

Target Macro
 
What can I add to this macro so that it only gets activated when the same
cells in column B have contents? i.e. B6, B8, B10?

Sub Target()
ActiveCell.FormulaR1C1 = "Target"
Range("C6").Select
ActiveCell.FormulaR1C1 = "Target"
Range("C8").Select
ActiveCell.FormulaR1C1 = "Target"
Range("C10").Select
ActiveCell.FormulaR1C1 = "Target"
Range("C12").Select
ActiveCell.FormulaR1C1 = "Target"
Range("C14").Select
End Sub


Don Guillett

Target Macro
 
something like
sub puttarget()
for i=6 to 10 step 2
if cells(i,"b")<"" then cells(i,"c")="Target"
next i
end sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MCheru" wrote in message
...
What can I add to this macro so that it only gets activated when the same
cells in column B have contents? i.e. B6, B8, B10?

Sub Target()
ActiveCell.FormulaR1C1 = "Target"
Range("C6").Select
ActiveCell.FormulaR1C1 = "Target"
Range("C8").Select
ActiveCell.FormulaR1C1 = "Target"
Range("C10").Select
ActiveCell.FormulaR1C1 = "Target"
Range("C12").Select
ActiveCell.FormulaR1C1 = "Target"
Range("C14").Select
End Sub




All times are GMT +1. The time now is 02:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com