View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
bevchapman bevchapman is offline
external usenet poster
 
Posts: 16
Default Macro to clear contents and put an X

Thank you! Works perfect!

"Luke M" wrote:

This will clear contents of columns E:N of whatever row you are currently on,
and put a "X" in the P column. Not sure if you really needed the cell below
the "X" selected or not, but I included it anyway.

Range("E" & ActiveCell.Row & ":N" & ActiveCell.Row).ClearContents
Range("P" & ActiveCell.Row).Value = "X"
Range("P" & ActiveCell.Row+1).Select

If you're detemrining the row via the macro, simply replace 'ActiveCell.Row'
with a number/variable.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"bevchapman" wrote:

I can get a macro to work on one row but I want to be able to use on any row.
Here is what i have so far:
Range("E19:N19").Select
Selection.ClearContents
Range("P19").Select
ActiveCell.FormulaR1C1 = "X"
Range("P20").Select

I want to be able to be on any row, whether it be Row 19 or Row 700 and be
able to run this. The column will stay the same.