Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB in EXCEL button problem 3

Status
Not open for further replies.

realbeginner

Technical User
Jun 2, 2005
8
0
0
GB
Hi. I want to use VB to create a button in EXCEL which puts a 1 in a cell then moves to the row underneath. If I click the same button I want it to put a 1 in this new cell and move downwards as before. I know this is simple stuff but I'm really stuck! (I can put a button in and record a macro) [This is so I can use EXCEL on an interactive whiteboard in the classroom to do the register]

Many thanks.
 
Give this a try.

Code:
With ActiveCell
    .Formula = "1"
    .Offset(1, 0).Select
End With
 
Hello again. I wanted to change the colour of my buttons and I'm having problems. Can you see what I'm doing wrong here?

CODE
Sub Button1_Click()
'
' Button1_Click Macro Present

With ActiveCell
.Formula = "1"
.Offset(1, 0).Select
End With
Button1.ForeColor = RGB(0, 255, 0)
' Colour - Green
End Sub
 
You wanted perhaps this ?
Button1.BackColor = RGB(0, 255, 0)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks! There is still a problem. Everytime I try to run it says:

Runtime error 424 Object required

Any suggestions? Have I got the code in the wrong place?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top