Consulting

Results 1 to 2 of 2

Thread: Complicated VBA

  1. #1

    Complicated VBA

    HI all

    I need some (actually a lot of help) with Excell

    When I open a workbook lets call it workbookA it should automatically have n few sheets locked and then some unlocked (SheetA, SheetB has to be locked SheetC and SheetD has to be unlocked) this is no problem with protect workbook/sheet I just want to give as much information as possible

    Where the VBA kicks in. Every time this workbook gets opened it has to get a new number in cellA1 (Example: If I open workbookA in cellA1 is a number 1, Now if I save and open it again cellA1 sould be 2). Now lets make it more complicated. I need n template using this code. When I open the template it wil change the cellA1 to 2 and if I save as to n new file and close, Open this template again It has to have CellA1 change to 3.

    I also need n code that wont allow me to save until I fill in certain fields say CellA2 and CellA3

    When I save then The entire workbook should automatically be protected so no one can change n thing. After the save only I can have the ability to change some stuff with the password.

    Sorry if I confused you. I will be happy to answer all question

    Thank you in advance

    Good luck

  2. #2
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,059
    Location
    Name Cell A1 as 'Counter" and set value to 0, then add the following section of code

    Private Sub Workbook_Open()
    [Counter].Value = [Counter] + 1
    End Sub
    Everytime you open the workbook the count value should increase by 1
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •