0

Hello and good morning,

I am new to Excel and VBA but am working on a spreadsheet that will greatly assist me in what I do. I have a button "btnQuery" that when pressed, should do a few things:

  1. Turn off calculations
  2. Perform 2 queries
  3. Update pivot charts
  4. Turn on calculations

It was great and working fine, until I decided to add in a progress bar. I'm working off an example from here: http://spreadsheetpage.com/index.php/tip/displaying_a_progress_indicator/

My intention is to make it so that the bar updates: 1. 5% before turn off calculations 2. 5% after turn off calculations 3. 35% after first query 4. 35% after second query 5. 15% after pivot updates 6. 5% after turn on calculations

However, whenever I "Show" the userform, it just locks up my page until I exit out of it. Here is the code that I have that will hopefully help:

Sub btnQuery_Click()
Userform1.Show
Call code.calcturnoff
Call code.data
Call code.pivot
Call code.calcturnon
End Sub

I currently have no code for the userform. Can anybody please offer some advice?

Thanks a million!

1 Answer 1

3

It's because you're waiting for input. Make sure you open it as a non-modal dialog:

Userform1.Show vbModeless
Sign up to request clarification or add additional context in comments.

1 Comment

This is the second time you've answered a question of mine. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.