Thread: On File Open
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Mir Khan Mir Khan is offline
external usenet poster
 
Posts: 36
Default On File Open

Hi Sir, nothing happens when i open the file. it works when i run it from the
visual basic editor.

i want it to work when we open the file.



"Mir Khan" wrote:

I have Macros enabled and work with different other macros. when i step
through it it works the way the macro is designed but when i save and close
the file after entering data in column A and re-open the file nothing happens
column A, J and P remains the same.

Please help.

"JE McGimpsey" wrote:

Do you have macros enabled?

Is the code in the ThisWorkbook code module?

What happens when you step through the code?

In article ,
Mir Khan wrote:

Hi Sir it does not work for me...

"Kevin B" wrote:

Change sheet name to match the sheet you want the update done in.

In the Workbook module place the following code:

Private Sub Workbook_Open()

With Sheets("Sheet1")
.Range("J1").Value = .Range("P1").Value
.Range("A1").Value = 0
End With

End Sub