Vba text box positioning on sheet

Last Edited By Krjb Donovan
Last Updated: Mar 05, 2014 10:02 PM GMT

QuestionEdit

Hello again I have embedded VBA text boxes onto anspreadsheet. These text boxes are positioned on top of an image box which I have 2 of, one on top of the other. I position the text boxes in different positions depending on what picture is showing by changing the left and top values of each text box to get the proper placement that I want.

My question is this when I click the button to show a different picture and shift the text boxes, the text box movement is slow. Is there a way to make it more fluent? Screenupdating does not seem to make a difference. Maybe it does not work with objects. If you have any advice on what I can do, I would appreciate it.

Thanks and best Denny

Private Sub CommandButton2_Click() ScreenUpdating = False Image1.Visible = False Image2.Visible = True TextBox1.Left = 306 TextBox1.Top = 170 TextBox3.Left = 280 TextBox3.Top = 188 TextBox2.Left = 255 TextBox2.Top = 153 Range("m20") = "13¡ã ¡À1" Range("m21") = "26¡ã ¡À1" Range("m22") = "0.025 ¡À.002" ScreenUpdating = True

End Sub

AnswerEdit

Denny,

I have not had occasion to witness a problem such as that. Your only issuing two commands - not sure how you would do it any differently. The only thing I can think to try is to not provide feedback with animation.

Not sure what version ofyou are using. If2007, it is found by clicking the office button, then on the bottom of the dialog, chooseoptions, then choose advanced, then go down to general section and uncheck "Provide feedback with animation"

I don't know if this is the cause, but it is the only thing I can think of.

If you want me to look at it, you can contact me.

Advertisement

©2024 eLuminary LLC. All rights reserved.