DAX???


Posted by RONNIE on June 26, 2001 11:49 PM

Hey Dax,

Thanks for helping me with my problem with the rotation number. But you said there were 2 options to do this. The option you gave me is not really the one I'm looking for. Cause it seems to me that I can't use the program on another computer then but only on one. So can you please give me the first option you talked about? I don't know if this matters but I use Excel 97 and with the Dutch language. But I don't think that really matters or do you think it does? Well...I hope to hear from you soon. Thanks again.

RONNIE

Posted by Dax on June 27, 2001 2:04 AM

Morning,

This code will store a value in cell IV65536 which will increase by 1 every time the workbook is saved. Enjoy!

Dim Rotation As Long

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Rotation = Sheets("Sheet1").Cells(65536, 256)
If Rotation = 0 Then Rotation = 2000
Rotation = Rotation + 1
Sheets("Sheet1").Cells(65536, 256) = Rotation
End Sub

Private Sub Workbook_Open()
'Get the rotation number from the sheet1, cell IV65536
Rotation = Sheets("Sheet1").Cells(65536, 256)
If Rotation = 0 Then 'The key doesn't exist
Sheets("Sheet1").Cells(65536, 256) = 2000
Rotation = 2000
End If
Load UserForm1
UserForm1.Label1.Caption = Rotation
UserForm1.Show
End Sub

Regards,
Dax.



Posted by RONNIE on June 27, 2001 6:01 AM

Hey Dax,

Thanks again! I'm really glad you helped me out with this one! Thanks A Million!!!

RONNIE