Macros on Protected Sheets #2

Hi ,
Now I have tried Alan's Solution to be able to run my Macros in Protected 
sheets but as I am not VB literate, I think I have made a Syntax mistake.

Sub Newaction() 
Sheet("Critical Path").Unprotect ("My Password") 
' Newaction Macro 
' Macro recorded 17/11/2004 by Clifford 
' 

' 
    Selection.AutoFilter Field:=1, Criteria1:="=" 
Sheet("Critical Path").Protect ("My Password") 
End Sub 

I receive a message "Compile error"
"Sub or function not defined"
Can you tell me what's wrong ? 

Regards

Paul.
0
Utf
11/18/2004 1:48:02 AM
excel.misc 78881 articles. 5 followers. Follow

2 Replies
659 Views

Similar Articles

[PageSpeed] 41

Hi Paul,

Try replacing:

            Sheet
with
            Sheets

---
Regards,
Norman



"Paul." <Paul.@discussions.microsoft.com> wrote in message 
news:BC0BA0A9-1FAE-421C-9EE7-6BA1C97AF48A@microsoft.com...
> Hi ,
> Now I have tried Alan's Solution to be able to run my Macros in Protected
> sheets but as I am not VB literate, I think I have made a Syntax mistake.
>
> Sub Newaction()
> Sheet("Critical Path").Unprotect ("My Password")
> ' Newaction Macro
> ' Macro recorded 17/11/2004 by Clifford
> '
>
> '
>    Selection.AutoFilter Field:=1, Criteria1:="="
> Sheet("Critical Path").Protect ("My Password")
> End Sub
>
> I receive a message "Compile error"
> "Sub or function not defined"
> Can you tell me what's wrong ?
>
> Regards
>
> Paul. 


0
normanjones (1047)
11/18/2004 2:00:07 AM
Norman,
Thanks a lot, now it works ! I am so happy as today I have to put my doc on 
a shared drive.
Bye

"Norman Jones" wrote:

> Hi Paul,
> 
> Try replacing:
> 
>             Sheet
> with
>             Sheets
> 
> ---
> Regards,
> Norman
> 
> 
> 
> "Paul." <Paul.@discussions.microsoft.com> wrote in message 
> news:BC0BA0A9-1FAE-421C-9EE7-6BA1C97AF48A@microsoft.com...
> > Hi ,
> > Now I have tried Alan's Solution to be able to run my Macros in Protected
> > sheets but as I am not VB literate, I think I have made a Syntax mistake.
> >
> > Sub Newaction()
> > Sheet("Critical Path").Unprotect ("My Password")
> > ' Newaction Macro
> > ' Macro recorded 17/11/2004 by Clifford
> > '
> >
> > '
> >    Selection.AutoFilter Field:=1, Criteria1:="="
> > Sheet("Critical Path").Protect ("My Password")
> > End Sub
> >
> > I receive a message "Compile error"
> > "Sub or function not defined"
> > Can you tell me what's wrong ?
> >
> > Regards
> >
> > Paul. 
> 
> 
> 
0
Paul297 (622)
11/18/2004 2:21:04 AM
Reply:

Similar Artilces:

OUTLOOK NEWS #2
Once again my news does not work. When I click it, I get a folder full of outlook stuff. This has happened before and someone here helped me. I, unfortunately, do not remember what to do. Next time I will save the instructions as this seems to be happening again and again. The word news appears at the top but when clicked there is nothing but the folder. Help Please! Thanks! You mean you cannot start the Newsreader from within Outlook? Go to Internet Explorer and make sure Outlook Express is set as the default newreader. For other solutions see; http://www.howto-outlook.com/faq/news....

lookup problem #2
I have a sheet with J11 called Buyers # and K11 called Buyers name. On the next sheet called Buyers there is a list with B1 being the buyers number, and C2 is the buyers names. How can I enter a number on the first sheet and get the corresponding name to come up? Todd Have a look in HELP index for VLOOKUP -- Don Guillett SalesAid Software donaldb@281.com "Todd Fischer" <todd@fischerhome.net> wrote in message news:evMAjQDPEHA.3052@TK2MSFTNGP09.phx.gbl... > I have a sheet with J11 called Buyers # and K11 called Buyers name. On the > next sheet called Buyers there is a...

Similar multiple entries not downloading #2
Hi, I am facing issue in downloading similar multiple transactions - eg- I have 3 southwest air ticket purchase transactions on a particualr day , where each tickets is for $60. Now in my bank statement, these appear as - 1-aug Southwest $60 1-aug Southwest $60 1-aug Southwest $60 - which is correct as i purchased 3 tickets. now when i download in money, only one transaction comes as - 1-aug Southwest $60 -other 2 are not downloaded. It seems money is treating other two as duplicate. Can someone tell me how can i get such t...

How do I use a password to protect an Excel file from peeping eyes?
Basically I finished my account tracker, but I would rahther use a password to prevent others from openning at all, I tried the Protect>>Protect workbook, but it doesn't work. Thanks. Do a file|SaveAs (you can use the same name). Then on that dialog Tools|General Options|provide a password to open (xl2002 wording) I think it was: tools|Options in earlier versions (but still under the file|saveas dialog) Fat Cat wrote: > > Basically I finished my account tracker, but I would rahther use a password > to > prevent others from openning at all, I tried the Protect>...

Header/Footer #2
When we open a workbook, we would like the header/footer to default to an 8 instead of 10. We always end up changing it from a 10 to an 8. Any way for this to default instead of creating a new template? Excel 2002. Thank you. You need to save a template file (called Book or Sheet) in the XLSTART folder. Look in Help under Standard Template for more details. Bernard "Kim" <hanke@wickpilcher.com> wrote in message news:1ca0001c38870$7cf791a0$a601280a@phx.gbl... > When we open a workbook, we would like the header/footer > to default to an 8 instead of 10. We always ...

Smartlist export to Excel #2
Quantities for Inventory Items are set-up in our database with zero decimals. When exporting 'Inventory Purchase Receipt' information to Excel, quantities receipt and quantities sold, greather than 1000, are shown only the first digit in Excel, for example 4,799 is shown for 4. Any idea how to fix it??? Thanks, -- Toni Sounds more likely that the file is being exported as a csv using the print function in smartlist. -- Mick "Toni" wrote: > Quantities for Inventory Items are set-up in our database with zero decimals. > When exporting 'Inventory Purchase ...

source sheet to auto fill 2 other sheets
sheet1 witch is what i fill out (source data)i want the data to be auto filld into the next too sheets..an to also sort the the data (by date- verry important) from the 1st sheet. all 3 sheets r totaly difernt..same names though.. thx for any help ...

I want a cell should 2 accept only >=0 or <=30 or Y or N
I want a cell should to accept >=0 or <=30 or Y or N Regards Brijesh =OR(AND(A1>=0,A1<=30),A1="Y",A1="N") In "Custom" for Data Validation. -- Regards Dave Hawley www.ozgrid.com "Brijesh Poojary" <Brijesh Poojary@discussions.microsoft.com> wrote in message news:1F46DC05-D143-407F-BB81-D5D9109914D6@microsoft.com... > > I want a cell should to accept >=0 or <=30 or Y or N > > Regards > Brijesh ...

Customizing -2^2
Shouldn't minus a squared number be a minus number? In Excel -2^2 = 4. To keep it negative I have to write -(2^2). It's very easy to make mistakes because I also work with Quattro Pro which works differently. Is there a way to customize this in Excel so that -2^2 = -4? Thanks. In Excel the negation takes precedence over the power operator. However, subtraction is a lower priority. 0-2^2 results in -4. Does that help? Regards, Fred. "Tim Walters" <timwalters@DROPTHISterra.es> wrote in message news:3bb8ue.of8.17.1@news.alt.net... > Sho...

Print Macro
Cell D5 represents a variable number from 1-120, the input changes the data accordingly on the whole workbook. I have input a macro to enter the number 1, print the document range A1:AB54 and then input number 2 and so on until i have 120 pages. This a frequently changing schedule and for review and distibution, would rather have a pdf doc. I changed the printer from the default to a pdf writer, when the macro runs it prints to the pdf doc but when the pdf document opens up, the macro stops after the first one, it does not go back to excel to work on number 2 etc.. Is there a ...

Too many cell formats #2
I have a set of spreadsheets that I am unable to change the format of any cells. When I try to change the background color, font or font size, an error message pops up saying there are too many cell formats. I really want to avoid having to re-create all of these spreadsheets. Please help. Thank you. Excel has a built in limit to the number of cell formats. You have reached that limit. As the message indicates, you cannot use any additional cell formats. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "wsdanalyst" <...

Printing multiple charts #2
My question is - i have multiple charts on the same worksheet. Is it possible to print them on separate pages without selecting each one individually? Hi, Depending on you layout inserting page breaks may solve your problem. Cheers Andy Edwina wrote: > My question is - i have multiple charts on the same worksheet. Is it > possible to print them on separate pages without selecting each one > individually? -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info Hi Edwina, Here is a possible workaround. Go to View>Page Break Preview Select a range of cells and the...

How can I translate text in many cells of an Excel sheet from English to Greek with VBA
Hi all, I have a spreadsheet with thousands of rows and columns of text that I'd like to translate into Greek. Can anyone tell me how I might do that using VBA with some free service or API online? Many thanks in advance. Kim Kim wrote, on 01st March 2012 00:11 UTC + 1 : > Hi all, > > I have a spreadsheet with thousands of rows and columns of text that > I'd like to translate into Greek. > > Can anyone tell me how I might do that using VBA with some free > service or API online? > > Many thanks in advance. > > Kim Hello, This is a quite classical...

cell reference problem #2
I am trouble with cell references in a spreadsheet. Some cells will display the cell reference rather than the value it points to. For example the cell will display =A1 as text rather than the content of that cell. What could cause this???????? thanks in advance david Hi David, First check that you have calculation turned on. Tools, Options, Calculation, automatic calculation If that is the problem and it recurs, see my slowresp to see how to spot the problem earlier. The other possibility is that you have Text formatting instead of General or a numeric format. Other things t...

X axis on 0 on Line-Column on 2 Axes
Is there a way on a Line-Column on 2 Axes chart to have the 0 value on both the bar and line axes be straight across from each other even though the bar chart is in 1,000s and the line axes is in single digits and has negative numbers? Only way I can figure is to put negative numbers in the bar axis as well. Try this: http://peltiertech.com/Excel/Charts/AlignXon2Ys.html - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services, Inc. http://PeltierTech.com/WordPress/ _______ "Supe" <Supe@discussions.microsoft.com> wrote in message news:F1174954-513D-...

Problem while tring to run a macro designed to save embedded images
Tink@discussions.microsoft.com Please solve me the following problem I'm getting an error as Run-time error '91' Object variable or with block variable not set while trying to run the macro in VBA. Thanks in advance How can you expect anyone to know without seeing your code? Post a message in the newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_vba . And include a small code...

Change file name #2
Hi, I've been searching for a solution to the following problem for more than a week. I've posted it here a couple of times, and got some good ideas, but unfortunately they did not work. The variable "myfolder1" has the correct value, followed by ".xls" as it should. I'd be very thankful if someone could find my error. This is the original question: I am new to Exel, and i cannot find my error in the following script. The error is: Run time erroro '9' Subscript out of range and it always stops on the "windows(my folder1).activate" line...

MACRO Recorded and saved does not run the second time.
Hello, The Macro was created on a Vista system. Steps: Developer Record Macro Macro entered --------------- Record Macro Macro name: month Store: Workbook OK ----------------- Macro was then entered Stop recording Developer Visual Basic Macro name shows as:month Run The macro ran OK ---------------------------. once more: Run Macro edit Save Book1 save as type: Excel Macro Enabled Workbook save developer Macro security Macro setting Enable all Macros Trust access to the VBA project object model --------------------------- When I tried to run it once mor...

Lost all inbox and contacts etc when removed server #2
I found the outlook.ost file. Can I reimpost this to Outlook? Can I somehow set it or use it as the "personal data files" that the outlook dialog box requested? I dont get why I was able to access the contacts emails etc after I disconnected the exchange server BUT only after I removed the exchange server did it all disappear. Not sure how I was meant to continue this thread so I copied the previous question, comment and listed it as a new post -- hope this it ok protocol. Also someone else had recommended that I re-engage the server but it is neither listed nor frank...

Data from 1 sheet to another sheet in same worksheet but then sorted....
I'm importing data from other worksheets with the database query function, this does carry a possibility to sort but due to specific matters I can't use the sorting function. My idea is now to have the data thus important automatically listen on another sheet in the same worksheet but on another sheet but this time sorted according to certain criteria. I'm sure this is easy with lists etc and filters, but what I'm looking for is something simple where even I can work with. Your suggestions are very welcome, thanks, martin ...

arrow keys for child window of dialog box #2
Hi, I have created a dialog box with MFC. I have created an opengl window as a child to the dialog box. on the window I am drawing using opengl. now I want to update my drawing if the arrow keys are pressed. How should I do it . I am new to MFC. Thanks and Regards. Hi, Handle WM_KEYDOWN message (let the wizard do it for you as you are new to MFC). Then you can put some kode like so: void CMyWnd::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { switch (nChar) { case VK_LEFT: YourUpdateCode1(); break; case VK_UP: YourUpdateCode2(); break; case VK_RIGHT: YourUpdateCode3...

Transfer Outlook Express to Outlook #2
I have just purchased a new computer which will have Outllook 2007 installed. I currently use Outlook Express as my email reader. Will it be possible to transfer all of my OE folders and messages to the new Outlook, and if so, how easy (or complicated) will that be ? begin 666 p.gif M1TE&.#EAU0`.`)$``/___P``_P`````*(R'Y! $`````+ ````#5``X```+_ MA(^IR^T/HYRTVHNAR+P?L7EB%P1&V: C!;9?UX:KA@WV;=QXK@^\7BFI`*JA MPG@T'9 8&2#DM#BCLP558E-D>=S$UC)4,A?CI?)TYDP-LMB+K;BR77/0T_ZA MUZ/N._YYY^4C>+#U53@8E&:&9E8DMDB4%B;$^&BT!A@'QXD@EP#UIIGYJ6DZ M>G78!6"8B&...

macro in excel to copy from excel to word
i have a database in excel...which i would like to take more advantag of. I also have some forms in Word that I was hoping to be able to get the to be automatically completed using the excel database. Initially thought this would be quite simple.... just record the macr then modify it to suit. This using simple copy from excel and paste into word document, o pasting into form..field..values. I have done a little before with excel macros - to a level of 'usin excel programming for dummies' book. But really do not know where t start now. Have seen this: "Dim appWD As Word.Appl...

CRM 1.2 on SBS 2003: External Error. No Such Object on Server
Users cannot get to CRM via WEB. They would get error box: No Such Object on Server. I got this from Event Viewer: MSCRM Platform Error Report: -------------------------------------------------------------------------------------------------------- Error: There is no such object on the server. Error Message: There is no such object on the server. Error Details: Details on this error have not been provided by the platform. Source File: Not available Line Number: Not available Stack Trace Info: at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain()...

RPC over HTTP problem #2
I have configured an Outlook 2003 client to use RPC over HTTP over the internet (DSL) with an Exchange mailbox that is over 15 GB in size. When I tested out the connection with a much smaller test mailbox, Outlook launched fine. When I tried to open the very large mailbox, the Outlook client tried several times to connect, but failed. When I then tried to reconnect to my smaller test mailbox, that failed as well. Thinking that something had happened at the server, I went to another machine, I was able to successfully connect the smaller test mailbox. Does anyone know what is happening?...