Freedom Computers
Q-Scripting
Q-Scripting
Screen Updating ' ****************************************
' * SWITCH OFF SCREEN UPDATING
' *****************************************
Application.ScreenUpdating = True
Application.ScreenUpdating = False
Select & Open a file ' ****************************************
' * SELECT User FILE
' *****************************************
MsgBox ("Select the User Price List file")
UserFile = Application.GetOpenFilename("excel files(*.*),**", , "Select the User file")
If FIRSTFILE = "False" Then Exit Sub
Workbooks.Open Filename:=UserFile
Cells(1, 1).Select

' ****************************************
' * EXTRACT JUST THE FILE NAME AND NOT THE WHOLE PATH
' *****************************************
For X = Len(UserFile) To 1 Step -1
If Mid(UserFile, X, 1) = "\" Then
UserFile = Right(UserFile, Len(UserFile) - X)
End If
Next X
Windows(UserFile).Activate
Select Sheet & Delete Sheets("MODEL").Select
Cells.Select
Selection.Delete Shift:=xlUp
Working with Worksheets Dim WS As Worksheet

' ****************************************
' * USER INPUTS FIRST WORKSHEET NUMBER
' *****************************************
FIRSTSHEET = InputBox("Enter the number of the first worksheet to be used. Usually Column 3")
Set WS = Worksheets(FIRSTSHEET)


' ****************************************
' * LOAD EACH WORKSHEET IN TURN BUT ONLY DOING MODELS
' *****************************************
NR = 1
Do Until WS Is Nothing
Worksheets(WS.Name).Activate
SHEETNAME = ActiveSheet.Name

' CARRY OUT THE PROGRAMMING TASKS ON THIS WORKSHEET

Set WS = WS.Next
Loop
< style="position:absolute;left:39px;top:266px;width:891px;height:576px;">