save when populated

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
 
F

Frank Kabel

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
 
V

Vato Loco

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
 
F

Frank Kabel

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)
 
F

Frank Kabel

Hi
have you put this code in the worksheet module (and not in a standard
module?)
 
R

Rollin_Again

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
 
Top