Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default On File Open

Hi Experts, i have a question with three column involved in it.
column A (where a number is entered [if required] whenever the file is opened)
column J ( where the previous total is stored)
column P (P1=J1+A1)
when ever this file is opened Column A should get set to '0' (zero)
automatically, and column J should get the value that is stored in column P.

i am not sure if this makes any sense to you guys. please ask for
clarification.

PLEASE HELP!!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,316
Default On File Open

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

--
Kevin Backmann


"Mir Khan" wrote:

Hi Experts, i have a question with three column involved in it.
column A (where a number is entered [if required] whenever the file is opened)
column J ( where the previous total is stored)
column P (P1=J1+A1)
when ever this file is opened Column A should get set to '0' (zero)
automatically, and column J should get the value that is stored in column P.

i am not sure if this makes any sense to you guys. please ask for
clarification.

PLEASE HELP!!!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default On File Open

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

--
Kevin Backmann


"Mir Khan" wrote:

Hi Experts, i have a question with three column involved in it.
column A (where a number is entered [if required] whenever the file is opened)
column J ( where the previous total is stored)
column P (P1=J1+A1)
when ever this file is opened Column A should get set to '0' (zero)
automatically, and column J should get the value that is stored in column P.

i am not sure if this makes any sense to you guys. please ask for
clarification.

PLEASE HELP!!!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default On File Open

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default On File Open

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




  #6   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Excel Discussion (Misc queries) 0 April 23rd 09 08:53 PM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
Open a file do a macro ( made) and open next succesive file SVTman74 Excel Programming 5 April 21st 06 10:14 PM
Open File or Switch Between Windows if File is Open Ricky Pang Excel Programming 2 July 8th 05 05:51 AM
Open File or Switch Between Windows if File is Open Ricky Pang Excel Programming 0 July 2nd 05 08:41 PM


All times are GMT +1. The time now is 12:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"