Topic: "Excel Hell" (page 1 of 1)

1
Author Post
sniperkid
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
i dont know whether this is possible or not but i want to get it so that when "button 4" is clicked, the square (that is highlighted with black around it) adds a "c" in a vacant spot. (adds a "c" if the cell is empty otherwise displays a message.



(here is the url just incase i got the insert image wrong or you cant see it.)
http://scss.fehost.org/screenshot.bmp

Edited by sniperkid on 28.09.2004 13:13:25
private message Website
Inferno
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
Hey SniperKid,

I know it's possible, but I'm not sure how.
You can do this with VBA, but I'm not into that in combination with Excel.
Press ALT+F11 in Excel to go to the editor
private message
sniperkid
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
yeah i know it must be possible somehow, i dont know sufficient VB to program it in that. just wondering if anyone could enlighten me on the subject.

Edited by sniperkid on 28.09.2004 13:13:08
private message Website
CommComm
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
Not sur I understood well th eproblem... But if the cell refs are well known (here M12) or can be computed, and if the button name (not caption) is for instance CommandButton4, then the code should be something like that :

Private Sub CommandButton4_Click()
If IsEmpty(Cells(12, 13)) Then
Cells(12, 13) = "c"
Else
MsgBox "Sniperkid got you ;-)"
End If
End Sub

To get access to the code, you must be in "create mode" (dont know if it is the right name, I use a french version). Display menu, then Tools bar, then Control tools box then Create icon. Then select the button, right click and "Display Code". It should display Private Sub CommandButton4_Click() // End sub. Just add the code above.

Then, don't forget to switch off Creating mode to click your button.

If pb, pm me.

Regards
Edited by CommComm on 28.09.2004 14:51:29
private message
sniperkid
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
thanks for that :thumbsup:

private message Website

Topic: "Excel Hell" (page 1 of 1)

1