Eyes are crossed ... Need help creating a log file from an excel workbook

Saffire

New Member
Joined
Mar 12, 2012
Messages
14
:pray:

I could really use some help here. I have a project that started off simple enough, and has now become a nightmare.

I need to create a log file from an excel work book. I only need one cell (ending balance) to write to the log file each time the shift supervisor saves the workbook.

In another cell (beginning balance), I need the work book to read the last entry from the log file. I have been going crazy trying to do this. I use to consider myself proficient in excel until I met VBA. Now, I realize that I know NOTHING!

Thanks for any and help.

Saffire
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi Saffire and welcome to the Board
This may help.
I have created a sheet named "log" and run the following code at workbook open to record an "opening value" and also the date and user name. It then saves the workbook
If you want it to add a value when the supervisor closes the workbook you'll need to to do the same thing with a workbook close event
You'll need to change the reference in red to suit
Rich (BB code):
Sub workbook_open()
Dim lra As Long
lra = Sheets("log").Range("A" & Rows.Count).End(xlUp).Row
lra=lra+1
Sheets("log").Range("A" & lra) = VBA.Now
Sheets("log").Range("B" & lra) = VBA.Environ("username")
Sheets("log").Range("C" & lra) = Sheets("Sheet1").Range("A1").Value
ActiveWorkbook.Save
End Sub
 
Upvote 0
Michael M. Thank you thank you thank you ... that has worked perfectly ... I was even able to figure out how to switch it to a close_workbook statement and now everything works as it is suppose to ... I wish that I had swallowed my pride sooner and asked for help ... that will teach me in the future.

Saffire:rofl:
 
Upvote 0
Glad it worked...and thanks for the feedback...:beerchug:
Rather than "swallowed the pride", consider it as "I tried my best, and learned something along the way"......just needed a little help, as we all do sometimes !!
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top