Run-time error '1004' select method of worksheet class failed - when hiding a worksheet

fkapyela

New Member
Joined
Feb 24, 2022
Messages
6
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I have hidden 3 worksheets, and just after hidding I am not able to submit entry.
When I debug the error is below:
Sub TrainingDatabaseFinal2()
'
' TrainingDatabaseFinal2 Macro
' This macro submits and deletes data
'

'
Sheets("Intermediate").Select
Range("A2:Q2").Select
Selection.Copy
Sheets("DataBase").Select
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
Range("R3").Select
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Range("Table1[[#Headers],[Training Type]]").Select
Selection.End(xlDown).Select
ActiveWindow.SmallScroll Down:=-6
ActiveWindow.SmallScroll Down:=-3
ActiveCell.Offset(1, 0).Range("Table1[#Headers]").Select
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
ActiveCell.Rows("1:1").EntireRow.Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Data Entry").Select
ActiveWindow.SmallScroll Down:=21
Range("G33").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("D33").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=-6
Range("M25").Select
Selection.ClearContents
Range("J25").Select
Selection.ClearContents
Range("G25").Select
Selection.ClearContents
Range("D25").Select
Selection.ClearContents
Range("M23").Select
Selection.ClearContents
Range("J23").Select
Selection.ClearContents
Range("G23").Select
Selection.ClearContents
Range("D23").Select
Selection.ClearContents
Range("D21").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=-12
Range("G12").Select
Selection.ClearContents
Range("D12").Select
Selection.ClearContents
Range("M10").Select
Selection.ClearContents
Range("J10").Select
Selection.ClearContents
Range("G10").Select
Selection.ClearContents
Range("D10").Select
Selection.ClearContents
End Sub
 

Attachments

  • excel.JPG
    excel.JPG
    56.4 KB · Views: 11

fkapyela

New Member
Joined
Feb 24, 2022
Messages
6
Office Version
  1. 2016
Platform
  1. Windows
Sorry ignore above message.
I have managed and its working.
I am so grateful for your help!!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
65,502
Office Version
  1. 365
Platform
  1. Windows
You are welcome.
Glad I was able to help!
 

Forum statistics

Threads
1,176,095
Messages
5,901,371
Members
434,887
Latest member
zoath

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top