I am trying to create a screen capture. I have a user form with a frame which I have the below code so on keypress, the frame moves around the userform
Private Sub Frame1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Select Case LCase(Chr(KeyAscii))
Case "w"
Frame1.Top = Frame1.Top - 1
Case "s"
Frame1.Top = Frame1.Top + 1
Case "a"
Frame1.Left = Frame1.Left - 1
Case "d"
Frame1.Left = Frame1.Left + 1
End Select
End Sub
What i want to know is,if I create another frame, lets call this frame2, and when I move the original frame over frame2, is there a way to screen print? would it have anythin to do with values of the the two frames like a cell or am I completely off the mark?
Thanks in advance
Try:
Private Sub Frame1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Select Case LCase(Chr(KeyAscii))
Case "w"
Frame1.Top = Frame1.Top - 1
Case "s"
Frame1.Top = Frame1.Top + 1
Case "a"
Frame1.Left = Frame1.Left - 1
Case "d"
Frame1.Left = Frame1.Left + 1
End Select
If Frame1.Top = Frame2.Top And Frame1.Left = Frame2.Left Then
Application.SendKeys "({1068})"
Me.Hide
ActiveSheet.Paste 'paste somewhere
End If
End Sub