Announcement

Collapse
No announcement yet.

(pls I need help!) click object to select a cell and display the value to a txtbox

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • (pls I need help!) click object to select a cell and display the value to a txtbox

    Ace Project.xlsm

    3 days ago
    Hi

    I'm Zim from the Philippines and I'm just a beginner in Excel vba. I'm really hoping that someone here can help with my little project for my work. I'm trying to create an evaluation form that will evaluate if our customer is likely to be satisfied or dissatisfied. I have attached here my unfinished file.

    I managed to put some highlighting effect when the mouse hover on my emoticons using 2 transparent label boxes. But what i would like to achieve is that when i click the label that makes the highlight effect visible, the 2nd label that hides the highlight effect should be disabled and select the corresponding "emotion" from cell AF5:AF14 and display the value to BegEmTxtBx.

    Thank you and more power.

    Zim

  • Tom Rowe
    replied
    Hi Zim,

    Firstly you don't need the secondary highlighting effect lables (Shapes) MouseMoves if you implement a reset routine which you call before making the Highlight Rectangle Visible, this works much better and I use this method for MouseOver effects on VBA UserForms ...

    Code:
    Private Sub FurLbl_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    
    ResetShapes
    Sheet1.Shapes("Rectangle10").Visible = msoTrue
    
    End Sub
    
    Private Sub ResetShapes()
    
    For intRectangle = 1 To 10
       Sheet1.Shapes("Rectangle" & Trim(Str(intRectangle))).Visible = msoFalse
    Next
    
    Sheet1.Shapes("ExcLabel").Visible = msoTrue
    Sheet1.Shapes("AppLabel").Visible = msoTrue
    Sheet1.Shapes("ConfLbl").Visible = msoTrue
    Sheet1.Shapes("GrateLbl").Visible = msoTrue
    Sheet1.Shapes("RelievLbl").Visible = msoTrue
    Sheet1.Shapes("HelpLbl").Visible = msoTrue
    Sheet1.Shapes("SadLbl").Visible = msoTrue
    Sheet1.Shapes("ConfuLbl").Visible = msoTrue
    Sheet1.Shapes("DisgusLbl").Visible = msoTrue
    Sheet1.Shapes("FurLbl").Visible = msoTrue
    
    End Sub
    To display the Emoticon's value to BegEmTxtBx simply use the Shape's Click Event.

    Code:
    Private Sub FurLbl_Click()
    
    Sheet1.Cells(8, "I") = "Furious"
    Sheet1.Shapes("FurLbl").Visible = msoFalse
    ResetShapes
    
    End Sub
    Note: I also call the ResetShapes routine here to remove the Highlighting effect. If you move the mouse the Highlighting effect will reappear there is no way that I know of round this because you are using the MouseOver event to apply the highlighting.

    I have attached an updated spreadsheet for you.

    Regards,

    Tom Rowe...
    Attached Files

    Leave a comment:

Working...
X