erutherford
Active Member
- Joined
- Dec 19, 2016
- Messages
- 449
Not sure what is causing the issue here but I do know people here will spot in a second.
I have 3 modules that I call for in another module. The main module works fine calling two other modules, but not three! Each works fine separately, but when all 3 are called "error" occurs.
"HideColumns" causes the error "Sub or Function not defined". It works fine when run separately, but not will called. Here is the code for HideColumns
I have 3 modules that I call for in another module. The main module works fine calling two other modules, but not three! Each works fine separately, but when all 3 are called "error" occurs.
VBA Code:
Sub Openflashdrive()
Dim strFile As String
MsgBox "Select * regdwnld.xlsx * file next."
strFile = Application.GetOpenFilename(FileFilter:="Excel files, *.xlsx", Title:="Choose regdwnld file")
Workbooks.Open strFile
Call ReorderColumns
Call AutoFitColumns
Call HideColumns
End Sub
VBA Code:
Private Sub HideColumns() 'Hide Columns
Dim wb As Workbook
Dim ws As Worksheet
Set wb = Workbooks("regdwnld.xlsx")
Set ws = wb.Worksheets("export")
ws.Activate
ws.Range("K:BT").EntireColumn.Hidden = True
End Sub
Thanks in advance!