Ask Experts Questions for FREE Help !
Ask
    Samantha_92's Avatar
    Samantha_92 Posts: 2, Reputation: 1
    New Member
     
    #1

    Jun 12, 2008, 11:16 AM
    Making a counter go up by 1
    How do I make an Excel Table update every time I use it?

    e.g -----> 1 2 3 4 whenever I use it

    Any help is appreciated.
    JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #2

    Jun 12, 2008, 02:26 PM
    Try this macro.

    Press Alt + F11 > select ThisWorkbook > paste in the code below. Every time you open the file it will increment cell A1 in Sheet 1 (change the reference A1 to whichever cell where you want this to happen)

    Excel -- VBA -- Adding Code to a Workbook


    Code:
    Public Sub Workbook_Open()
      Dim Rng As Range
      Set Rng = ThisWorkbook.Sheets(1).Range("A1")
      
        With Rng
            .Value = .Value + 1
        End With
        
    End Sub
    Attached Files
  1. File Type: xls !Book1.xls (20.5 KB, 140 views)

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

The bean counter. [ 3 Answers ]

Did you hear about the constipated accountant? He couldn't budget.

Viagra Over the Counter [ 5 Answers ]

A middle aged man, about 5 foot 8 inches tall, walks into a Walmart and asks where the pharmacy counter is. He is directed to it. When he reaches it, he asks to see the pharmacist. The pharmacist comes and the man, looking around furtively, asks quietly, "Do you sell Viagra here?" The...

Corian Counter [ 2 Answers ]

What tool would you use to cut Corian? I have a piece from an old kitchen counter that I want to cut into a 20"x20" cutting board. It is about 3/4" thick and the longest cut I have to make is about 24". Thanks

Counter-Strike [ 3 Answers ]

Ok does anyone know how to change your spray logo on Halflife: CounterStrike? If you know how please tell me..


View more questions Search