• Privacywetgeving
    Het is bij Helpmij.nl niet toegestaan om persoonsgegevens in een voorbeeld te plaatsen. Alle voorbeelden die persoonsgegevens bevatten zullen zonder opgaaf van reden verwijderd worden. In de vraag zal specifiek vermeld moeten worden dat het om fictieve namen gaat.

Cellen vergrendelen zonder tabblad beveiligen

Status
Niet open voor verdere reacties.

Bigbrains

Gebruiker
Lid geworden
27 mei 2009
Berichten
57
Hallo Allen,

Ik zit met het volgende heb onderstaand bestand waarmee ik tabbladen van alle bestanden uit 1 map kan importeren.
Alleen zit ik nu met het probleem dat de tabbladen die ik wil importeren beveilgd zijn om zo een aantal formules te beschermen. De macro die ik in het bestand heb staan kan echter geen beveiligde tabbladen importeren.

Mijn vraag is dus tweeledig. weet iemand hoe ik de macro kan aanpassen zodat deze ook beveiligde tabblade importeert.

of weet iemand hoe ik bepaalde cellen in een tabblad kan vergrendelen zonder het tabblad te beveiligen.

hoop dat iemand hier raad mee weet.

gr,
 

Bijlagen

  • Combine Workbooks112.xls
    42 KB · Weergaven: 36
Antwoord op je tweede vraag, zie bijlage.
 

Bijlagen

  • Combine Workbooks112.zip
    74,7 KB · Weergaven: 46
Antwoord op je tweede vraag, zie bijlage.


Dank voor je reactie. dit werkt, alleen wanneer ik het bestand opsla en vervolgens weer open dan is de vergrendeling van de cellen verdewenen.

weet je hoe ik dat kan verhelpen?
 
Ik had dit ook al gemerkt, na een beetje Googlen kwam ik hierbij terecht:
Code:
You will be unable to scroll outside the area you have specified. Unfortunately, Excel will not save this setting after closing it. This means you need a very simple macro to automatically set the scroll area to the desired range by placing some code in the worksheet_Activate event.

Right-click the Sheet Name tab on which the scroll area should be limited and select View Code, then enter the following:

Private Sub Worksheet_Activate ( )

Me.ScrollArea = "A1:G50"

End Sub
As usual, press Alt/-Q to return to Excel proper and save your workbook.

Although you will not see a visible clue, such as the gray moat of the first method, you won't be able to scroll or select anything outside the specified area.

 Any macro that tries to select a range outside this scroll area (including selections of entire rows and columns) will no longer be able to do so. This is true particularly for recorded macros, as they often use selections.
 
 


If your macros do select a range outside the scrollable area, you can easily modify any existing macros so that they are not limited to a specific scroll area while operating. Simply select Tools  Macro  Macros... (Alt-F8), locate your macro name, select it, and click Edit. Place the following line of code as the very first line of code:

ActiveSheet.ScrollArea = ""
As the very last line of code in your macro, place the following:

ActiveSheet.ScrollArea = "$A$1:$G$50"
So, your code should look something like this:

Sub MyMacro( )

'

' MyMacro Macro

' Macro recorded 19/9/2003 by OzGrid.com

'



'

ActiveSheet.ScrollArea = ""

    Range("Z100").Select

    Selection.Font.Bold = True

ActiveSheet.ScrollArea = "$A$1:$G$50"

Sheets("Daily Budget").Select

ActiveSheet.ScrollArea = ""

    Range ("T500").Select

    Selection.Font.Bold = False

ActiveSheet.ScrollArea = "$A$1:$H$25"



End Sub
 
Vielen dank:d deze oplossing werkt
 
Laatst bewerkt door een moderator:
Onnodige quote verwijderd.
 
Status
Niet open voor verdere reacties.
Steun Ons

Nieuwste berichten

Terug
Bovenaan Onderaan