puzzle

N

nagileon

Hi there
I try to build a simple puzzle program using Microsoft Excell and VBA.
I load pictures: CommandButton1.Picture = LoadPicture("C:/puzzle/01.jpg")
I have this code but it should change pictures not captions:

End Sub

Private Sub CommandButton3_Click()

ChangeButtons CommandButton3

End Sub

Private Sub CommandButton4_Click()

ChangeButtons CommandButton4

End Sub

Sub ChangeButtons(CommandButton As MSForms.CommandButton)

Dim cAux$

If spbClicked Is Nothing Then
Set spbClicked = CommandButton

Else
cAux = CommandButton.Caption
CommandButton.Caption = spbClicked.Caption
spbClicked.Caption = cAux

Set spbClicked = Nothing

End If

End Sub

Can anybody help me, so it works on pictures not on captions ?
:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top