Jump to content

SUBIECTE NOI
« 1 / 5 »
RSS
Intrebari srl nou

Amenintat cu moartea de un numar ...

La multi ani @AndReW99!

Alegere masina £15000 uk
 TVR vrea sa lanseze o platforma d...

Strategie investie pe termen lung...

Modulator FM ptr auto alimentat p...

orange cablu f.o. - internet fara...
 Robinet care comuta traseul

A fost lansata Fedora 40

Samsung S24 plus

Imi iau un Dell? (Vostro vs others)
 Abonati Qobuz?

transport -tren

Platforma electronica de eviden&#...

Cot cu talpa montat stramb in per...
 

button (activex control) work on protected sheet

- - - - -
  • Please log in to reply
6 replies to this topic

#1
excentryc

excentryc

    Active Member

  • Grup: Members
  • Posts: 1,497
  • Înscris: 15.07.2005
Salut!
Am un sheet ptrotejat dar butonul de hide/unhide a coloanelor P:V nu mai functioneaza decat daca deprotejez foaia de lucru.
Codul mai jos:
Private Sub ToggleButton1_Click()
Dim xAddress As String
xAddress = "P:W"
If ToggleButton1.Value Then
	Application.ActiveSheet.Columns(xAddress).Hidden = True
Else
	Application.ActiveSheet.Columns(xAddress).Hidden = False
End If
End Sub


Ce trebuie sa fac?

Edited by MarianG, 12 January 2018 - 14:24.
code tags


#2
navistar_eagle

navistar_eagle

    Member

  • Grup: Members
  • Posts: 958
  • Înscris: 16.11.2017
Incearca :
 Application.ActiveSheet.Columns(xAddress).Hidden = ToggleButton1.Value


Edited by navistar_eagle, 12 January 2018 - 14:31.


#3
excentryc

excentryc

    Active Member

  • Grup: Members
  • Posts: 1,497
  • Înscris: 15.07.2005
nu merge

#4
excentryc

excentryc

    Active Member

  • Grup: Members
  • Posts: 1,497
  • Înscris: 15.07.2005
am incercat asta si a mers
Private Sub ToggleButton1_Click()
Dim xAddress As String
xAddress = "P:W"
ActiveSheet.Unprotect ""
If ToggleButton1.Value Then
	Application.ActiveSheet.Columns(xAddress).Hidden = True
	ActiveSheet.Protect ""
  Else:
  Application.ActiveSheet.Columns(xAddress).Hidden = False
  ActiveSheet.Protect ""
End If
End Sub


Edited by excentryc, 12 January 2018 - 15:59.


#5
navistar_eagle

navistar_eagle

    Member

  • Grup: Members
  • Posts: 958
  • Înscris: 16.11.2017
testeaza de curiozitate asa:
Private Sub ToggleButton1_Click()
Dim xAddress As String
xAddress = "P:W"
ActiveSheet.Unprotect ""
Application.ActiveSheet.Columns(xAddress).Hidden = ToggleButton1.Value
ActiveSheet.Protect ""
End Sub


Edited by MarianG, 13 January 2018 - 19:03.
removed quote


#6
excentryc

excentryc

    Active Member

  • Grup: Members
  • Posts: 1,497
  • Înscris: 15.07.2005
O sa incerc ... dar numai luni mai pot ca fisierul e la serviciu.
Merci anyway.

Edited by MarianG, 13 January 2018 - 19:03.
removed quote


#7
excentryc

excentryc

    Active Member

  • Grup: Members
  • Posts: 1,497
  • Înscris: 15.07.2005

View Postnavistar_eagle, on 13 ianuarie 2018 - 10:59, said:

testeaza de curiozitate asa:
Private Sub ToggleButton1_Click()
Dim xAddress As String
xAddress = "P:W"
ActiveSheet.Unprotect ""
Application.ActiveSheet.Columns(xAddress).Hidden = ToggleButton1.Value
ActiveSheet.Protect ""
End Sub


Merge !

Anunturi

Bun venit pe Forumul Softpedia!

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Forumul Softpedia foloseste "cookies" pentru a imbunatati experienta utilizatorilor Accept
Pentru detalii si optiuni legate de cookies si datele personale, consultati Politica de utilizare cookies si Politica de confidentialitate