ok some more help please

bensonsearch

Well-known Member
Joined
May 26, 2011
Messages
844
Im wanting an image to move up the screen(in a label) until the top, but here is that catch it must be visible the whole way.
my code is as follows:

ElseIf KeyCode = 32 Then
Label2.Visible = True
If Label2.Top > 299 Then
Do
Label2.Top = Label2.Top - 1
Loop Until Label2.Top = 1
ElseIf Label2.Top <= 1 Then
Label2.Top = 300
End If

the code makes the image go to the top then back down again but it happens instantly with no seeing the image inbetween or on its travel if you will.

any help would be great
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
i have tried 2 different ways of waiting (actualt wait with using time and one that just counts like a loop in a loop) but both time out and make excel stop responding. I have been putting it just before the loop statement. is that right?
 
Upvote 0
If I run this code in Excel 2003, the Label moves smoothly up the screen, albeit rather quickly:

Code:
Sub Test()
    Do
        Label2.Top = Label2.Top - 1
    Loop Until Label2.Top <= 1
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,290
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top