Cannot set visible property to the worksheet class

jarlej

New Member
Joined
Sep 24, 2020
Messages
2
Office Version
  1. 365
Platform
  1. MacOS
Hi,
Could anybody point me to a solution?

I get run-time error '1004' at the last line: Cannot set visible property to the worksheet class

VBA Code:
Sub kopierLoggPedTiltak()
    Sheets("LoggPedTiltak").Copy After:=Sheets(1)
    ActiveSheet.Visible = 1
    Sheets("Innhold").Visible = 0
End Sub

Thanks!

(I used to be a member like 10+ years ago, but couldn't find my old login :()
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

davesexcel

Well-known Member
Joined
Feb 26, 2006
Messages
1,089
Here is a topic on that

Just a note, the activesheet would be visible, you would not have to make it visible.

 

jarlej

New Member
Joined
Sep 24, 2020
Messages
2
Office Version
  1. 365
Platform
  1. MacOS
Hi, and thanks for the tip. I´ve already seen that topic, but I couldn't find a solution in that thread.
 

Watch MrExcel Video

Forum statistics

Threads
1,130,129
Messages
5,640,283
Members
417,134
Latest member
fjleroux187

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