• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel Reading Data from Access and CSV files - Splash Screen with Progress Bar

ianb

Member
Hi


Can any one provide a solution on the Open worksheet. I would like to display a user form - named Splash screen with a progress bar whilst reading the data nto excel once completed close the splash screen and display the user form - main menu.


Many Thanks.


Open Splash Screen

Retrieve Data

Close Splash Screen

Open User Form
 
Private Sub Workbook_Open()


UserFormSplash.Show False


' Reading Data once completed will close splash screen and load userformstart


UserFormSplash.Hide


UserFormStart.Show False


Sheets("????Select

Range("A1").Select


End Sub
 
@ianb


Please Try the Below Code


Private Sub Workbook_Open()

Dim sheet As Variant

Dim range As Integer

UserFormSplash.Show

' Reading Data once completed will close splash screen and load userformstart

UserFormSplash.Hide

UserFormStart.Show

UserFormStart.Hide

Worksheets("Sheet1").Activate

Worksheets("Sheet1").range("A1").Select


End Sub


Note: You can change sheet Name
 
@ Ian Try these

Sample Macro https://www.box.com/s/0a6b971ebda2d944017f


Working Example https://www.box.com/s/75768cb330466a7b2481
 
I have this progress bar in a module and would also whilst it is running the progress bar upload the data (reading data) what part of the code do I need to change to run both at the same time ?
 
Need reading data in excel at teh same time as this code.


Sub ProgressBar()

Dim i As Integer

DoEvents

With UserFormSplash

'SET MIN value to 0

.ProgressBar1.Min = 0

'SET Max value as per your requirement

.ProgressBar1.Max = 10000

.Show vbModel

'.ScrollBars = fmScrollBarsVertical

' run a loop to display progres bar

For i = 1 To 10000

'change the value of progress bar to show the progress using fill color

.ProgressBar1.Value = i

' chnage the caption of user form to display the percentage of task completed

.Caption = VBA.Format(i / UserFormSplash.ProgressBar1.Max, "0%") & " Complete"

DoEvents ' DoEvents allows the UserForm to update.

Next

End With

' task finish unload progress bar

Unload UserFormSplash

End Sub
 
[pre]
Code:
1 change  .ProgressBar1.Max = 10000
change its max value with total no of files which you want to import 

2 For i = 1 To 10000
change "10000" with total no of files

3 .ProgressBar1.Value = i
Add your code of import before this line
[/pre]
 
Back
Top