1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Excel Formula

Discussion in 'Software' started by Fergal1982, Nov 27, 2005.

  1. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    Guys, im using excel 2003, and want to put a button on a worksheet which will reset a specific set of cells to 0 when pressed. But i have no idea how to do this.

    Can anyone help?

    Thanks
    Fergal
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  2. SimonV

    SimonV Petabyte Poster Administrator

    6,616
    149
    228
    You could attach the following code to the button:

    Code:
    Range("E14").Select
    ActiveCell.FormulaR1C1 = "0"
    This is inserted between the Private Sub and the End Sub part of the buttons code. Obvuisly cahge the cell reference to the cell your wishing to set to zero.

    HTH
     
    Certifications: MOS Master 2003, CompTIA A+, MCSA:M, MCSE
    WIP: Keeping CF Alive...
  3. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    cool. ummmm. how do i create a button?
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  4. eyeball

    eyeball Nibble Poster

    82
    3
    0
    Is it the same cells each time?

    Record a macro of you deleting these cells (tools - macros - record macro)

    Then enable the forms toolbar, click the button, draw out your button, it shoudl then give you a popup to choose which macro you wish to use.

    This saves having to do any programming like mentioned above.
     
    Certifications: A+, Network +, MCSA
    WIP: CCNA, MCSE+security

Share This Page

Loading...