DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Christian Guest

    incrementing numbers in an excel template


    I would like to be able to automatically increment numbers when opening a
    workbook based on an excel template. example when opening a workbook number
    75 auto. pops up in a specific cell. only when i save the workbook will the
    next workbook opened contain the number 76. I would also like to somehow
    store these numbers in a database type format for reference purposes

    thank you,
    christian


  2. #2
    ke11ey Guest

    Re: incrementing numbers in an excel template


    "Christian" <Christian@cvimages.com> wrote:
    >
    >I would like to be able to automatically increment numbers when opening

    a
    >workbook based on an excel template. example when opening a workbook number
    >75 auto. pops up in a specific cell. only when i save the workbook will

    the
    >next workbook opened contain the number 76. I would also like to somehow
    >store these numbers in a database type format for reference purposes
    >
    >thank you,
    >christian
    >

    I don't know, would this help;

    With the object ThisWorkbook, event Activate
    Private Sub Workbook_Activate()
    'Sheets(1) renamed Log Sheet
    With ActiveWorkbook.Sheets("Log Sheet")
    .Cells(1, 1) = .Cells(1, 1) + 1
    End With
    End Sub
    Everytime I open the workbook the number in the cell A1 incraments by 1.


  3. #3
    christian Guest

    Re: incrementing numbers in an excel template


    thank you, i guess you


    "ke11ey" <ke11eyh@zdnetonebox.com> wrote:
    >
    >"Christian" <Christian@cvimages.com> wrote:
    >>
    >>I would like to be able to automatically increment numbers when opening

    >a
    >>workbook based on an excel template. example when opening a workbook number
    >>75 auto. pops up in a specific cell. only when i save the workbook will

    >the
    >>next workbook opened contain the number 76. I would also like to somehow
    >>store these numbers in a database type format for reference purposes
    >>
    >>thank you!
    >>christian
    >>

    >I don't know, would this help;
    >
    >With the object ThisWorkbook, event Activate
    >Private Sub Workbook_Activate()
    > 'Sheets(1) renamed Log Sheet
    > With ActiveWorkbook.Sheets("Log Sheet")
    > .Cells(1, 1) = .Cells(1, 1) + 1
    > End With
    >End Sub
    >Everytime I open the workbook the number in the cell A1 incraments by 1.
    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links