Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2006

    Unanswered: Making a command button work

    I want a command button that I can click. When it is clicked I want to make column of cells equal to a number in a certial cell if the cell in the column has "X 1D" in it. So lets say I paste a number 180 into cell D6. I have a column of cells D9-D22. When I click the button if a cell in D9-D22 has the value X 1D in it I want it to chenge that X 1D to 180. If the cell is blank leave it blank.

    Thank you in advance


  2. #2
    Join Date
    Feb 2006
    Hi Tom,

    Create a button - for example via the control toolbox toolbar, and in design mode right click on the button and select "view code".

    In VBA enter the following code to execute when the button is pressed

        Range("D9:D22").Replace What:="X 1D", Replacement:=Range("D6").Value
    Exit VBA, exit design mode and press the button.


Posting Permissions

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