save when populated

  • Thread starter Thread starter Vato Loco
  • Start date Start date
V

Vato Loco

I am using the below code to save a worksheet as changes are made. I
there a way to do the below, but only when cell "J75" is changed?


Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
ActiveWorkbook.SaveAs FileName:=ActiveSheet.Range("O6")

End Sub

Thanks, Vat
 
Hi
try
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
if intersect(target,me.range("J75")) is nothing the exit sub

activeworkbook.SaveAs FileName:=me.Range("O6")

End Sub
 
Hi Frank,

Thanks for the help, first of all.

I ran that and it is giving me a syntax error message on this line:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

Any suggestions?

Vat
 
Hi
change this line to
Private Sub Worksheet_Change(ByVal Target As Range)

Also make sure you put this code in your worksheet module (and not in
a standard module)
 
Hi
have you put this code in the worksheet module (and not in a standard
module?)
 
Try:


PRIVATE SUB WORKSHEET_CHANGE(BYVAL TARGET AS RANGE)

IF TARGET.ADDRESS = \"$J$75\" THEN
ACTIVEWORKBOOK.SAVEAS FILENAME:=ACTIVESHEET.RANGE(\"O6\")
END IF

END SU





Rolli
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top