Prevent Subs From Appearing On Alt+F8 Macro List

Aug 6, 2008

I have an add-in that I'm passing around to my users, and though it has 8 or 9 subs, it only has 2 that they need to see. However, I'd rather not relegate all of the code to a single module, as there is quite a bit of it. I'm aware that I could change all the subs to functions, but they would still appear in the UDF list, and this would also be confusing to the individual responsible for the upkeep of these macros (and I'd have to rework the code a little bit).

I'm just asking if there is any direct way to do this, before I go to the trouble of making a lesser workaround. Google seems to think no, but "don't show macros in list" isn't a very solid search.

View 9 Replies


ADVERTISEMENT

Combine Subs To Run And Appear As One In Macro List

Jul 13, 2009

I have a Sub that calls 8 other subs, can I hide the 8 subs on a users macro list?

I tried making the 8 subs "private subs", and it did hide them, but then my call sub macro didn't work.

Any thoughts?

View 9 Replies View Related

Prevent Custom Menu Appearing In All Workbooks

Sep 8, 2007

I added a menu command button to a toolbar in a specific workbook. The macro is housed only in that workbook and the macro needs to run on every worksheet in the workbook. However, the button also appears on EVERY Excel workbook that I open when it should not. How can I create a menu command that only appears in the workbook that contains the macro?

View 2 Replies View Related

Input IF Formula To Prevent Zeros Appearing In TOTAL Cell

Sep 10, 2012

How do I input an IF Formula to prevent Zeros appearing in the TOTAL cell ....

Example: TOTAL Cell (A10) =sumA1:A9

ALSO difference between two sums

Example TOTAL Cell (A20) =SumA10-A19

View 5 Replies View Related

Dynamic Named Ranges Not Appearing In F5 (GoTo) List

Mar 2, 2010

I want to start a new thread about this issue - it was previously listed on an old thread but slightly different topic: refer[url].

The problem is I have lots of Dynamic Named Ranges using formulae such as the following:
=OFFSET(RptPg!$F$9,0,0,MATCH("*",RptPg!$B$9:$B$200,-1),1)
. These named ranges are created in the Name Manager box and the code inserted in the RefersTo: box.

The ranges seem to work well and are dynamic as required. When I click on the range selector button against the RefersTo formula fo rthe range the range is correctly highlighted.

However, the range is not selectable from the F5(GoTo) command.

This then means for certain VBA operations, the range cannot be found and returns an error (Object not defined etc)

Is there anyway I can correct this or work around this - dynamic ranges are at the heart of my large workbook and fundamental to its performance>

View 9 Replies View Related

Add Macro To Call Subs Depending On Cell Value

May 16, 2014

I am trying to add a macro to the ACCT DATA sheet, which calls one of two subs (AddCarriertoChecklist() - or - ClrPolChList() located in seperate modules). The macro should call them depending on whether "X" is entered in a cell in column "E". The issue lies in that I have macros doing a few things to this sheet already, and I am unable to tie this one in.

I have the two subs (AddCarriertoChecklist() - or - ClrPolChList()) working. I just can't seem to get them called. This small bit is how I was attempting to call them.

[Code] ......

Below is how I currently have it tied in with the rest of the code for this sheet:

[Code] .....

What is it that I am missing?

View 2 Replies View Related

Excel 2010 :: Microsoft Date And Time Picker Control Not Appearing On Controls List

Jun 14, 2013

I was trying to use this guide to add a date picker in:

[URL]

and noticed that the date picker does not appear in my active x controls list.

I am definitely on Excel 2010 so it should be there right?

View 1 Replies View Related

Prevent Duplicate When Entry From List

Oct 9, 2012

How prevent duplicate when entry from list?

Attachment file : testing.xlsx

View 1 Replies View Related

Prevent Linked List Source Of ComboBox Being Sorted

Jul 19, 2006

I created a spreadsheet with several combo boxes that that is linked to other data.

When this data is sorted, the values in the combo boxes are automatically changed.

Is there any way to prevent the the values to change?

View 5 Replies View Related

Prevent Saving And Allow Only Through Macro

Mar 14, 2007

Prevent saving and allow only through Macro

I am contracting an excel template and need to stop users saving the file using “Save” or “Save As”. I am able to do this by using the private sub below:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Me.Saved = True
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Cancel = True
End Sub

I also understand that by switching to “Designer” mode you can save the file and once re opened designer mode will be switched off. What I need is to allow saving using a macro, is there a code that I can insert in the macro to switch designer mode?

View 9 Replies View Related

Macro To Prevent 'save-as'

Feb 21, 2002

Is there any way to write a macro which can prevent computer illiterate users from saving their files EVERYWHERE??

View 9 Replies View Related

Prevent Macro Interruption

Aug 8, 2007

I have a macro, that when running needs to display certain sheets that should be hidden again when the macro is done. I solve this by using the code

Sheets("Sheet1").Visible = True
'macro code
Sheets("Sheet1").Visible = xlVeryHidden

But what if the macro fails? Or if the user ends it by pressing Esc? Then he will be able to see the hidden sheet. Is there something I can write in the code that makes the macro hide the sheet, then show the error message?

View 5 Replies View Related

Prevent Private Sub Macro From Running

Nov 14, 2008

I need a line of code so that when I hit commandbutton2, the Private Sub Worksheet_Change(ByVal Target As Range) event macro on the same page DOESN'T run. The button clears certain lines, and when it runs the change event it ends up in an error, and I don't need it to run when hitting the commandbutton.

View 6 Replies View Related

Prevent Access To The Code Of A Macro

Feb 9, 2009

Is there a way to prevent access to the code of a macro? I am interested in sending out some macro's, but would prefer that the user only be able to run them, and not be able to access the code via the edit button. Curiously, there have been occasion's where I wanted to edit my own work, but the edit button did not function, so I had to exit and start over to proceed. From this I'm guessing there must be a way.

View 2 Replies View Related

Macro To Prevent Changing The Value Within A Cell

Jan 11, 2007

I would like to write a macro that performs the following function:

I have a value in cell A1

In cell A2, I have the formula "=A1"

I want to make it so that cell A2 can never be directly changed; the only way to change the value in A2 is by changing A1. A2 should always equal A1.

I want a message box to pop up and alert the user whenever they attempt to modify A2, instructing them that if they wish to change A2, they have to change A1.

I had written this macro, and it kinda does the trick:


Private Sub Worksheet_SelectionChange(ByVal Target As Range)


If Range("a2") Range("a1") Then
MsgBox "text goes here"
Range("a2").Value = Range("a1")
End If

End Sub

When I attempt to change cell A2, I get the MsgBox popup and it works how I want it to. However, when I alter cell A1, I get the same popup before cell A2 updates (to be precise, the popup occurs after I click another cell). I would like this to be immediate and without a MsgBox.

View 9 Replies View Related

Prevent Macro From Running If Cell Is Red

Apr 29, 2008

I have a macro that is run by clicking on a macro button. The macro copies the data from Sheet1 and pastes it in another sheet, Sheet2. I added some conditional formatting that colors certain cells red if others are blank on Sheet1. I would like to add some code to my macro that will not allow it to copy and paste from sheet1 to sheet2 if there are any red cells in the range.

View 9 Replies View Related

Prevent Formula #REF! When VBA Macro Deletes Columns

Aug 5, 2009

I'm using the following code to delete columns:

Dim rng As Range
Dim i As Integer, counter As Integer

Set rng = Range("1:1")

i = 1

For counter = 1 To rng.Columns.Count

'If cell i in the range contains an "x",
'delete the column
If rng.Cells(i) = "x" Then
rng.Cells(i).EntireColumn.Delete
Else
i = i + 1
End If

Next

My problem is that I have cells in other worksheets linked to the worksheet that is running this macro and everytime I run it, I get a handful of "#REF" errors. I think this problem might be solved if I could simply delete the contents of the column rather than deleting the entire column. How can I modify my code to do this?

View 4 Replies View Related

Prevent VBA Macro Firing Event Code

Nov 23, 2009

I'd like to know if there is a change event that only occurs when a target cell is changed by the user, but does not occur when i'ts changed by a macro. nfortunately, the Worksheet_Change event occurs in both cases.

View 2 Replies View Related

Prevent Cut/Copy/Move Macro Code

Sep 8, 2006

I have to issue template workbooks to people for budgeting purposes.

Within the workbooks are various numbers of worksheets pre -formatted and ready for these people to enter data.

Some of the data in the worksheets is important to them as individuals but not to me so I have a series of macros that lift the information from the worksheets and put it into a worksheet more specific to me.

Because the users are on the whole not that good with Excel I have put in easy to use look up tables and various proctections to stop them adding or deleting rows or columns as this plays havoc with my macros.

There is one thing I have "so far" been unable to do and I wondered if anyone could help.

Is there a macro that I could put somewhere in the workbook which would detect when someone tried to cut and paste and would either put up a message box or stop them doing this?

The reason being they are cutting from one row to another and this is messing up the calculations which are protected.

Is there also a way to stop them changing the name on the sheet tab in the smae way?

View 9 Replies View Related

Merging Two VBA Subs?

Mar 21, 2012

I'd like to combine two VBA subs existing on a single sheet. Since they can't duplicate I need some sort of a switch statement...?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim VRange As Range, cell As Range
Dim Msg As String
Dim ValidateCode As Variant
Set VRange = Range("E4:E100")
For Each cell In Target

[Code]....

View 5 Replies View Related

Combining Two Subs Into One

May 20, 2014

I have two subs which I've been trying to combine into one. Essentially all that is changing is the slicer name and range value.

Here's what I have:

Code:
Private Sub Workbook_SheetPivotTableChangeSync(ByVal Sh As Object, ByVal Target As PivotTable)
Dim cache As Excel.SlicerCache
Set cache = ActiveWorkbook.SlicerCaches("Slicer_Project_Type3")
Dim sItem As Excel.SlicerItem
Dim myString As String
For Each sItem In cache.SlicerItems
If sItem.Selected = True Then
myString = myString & "," & sItem.Name

[code].....

But it's erroring out on me.

View 4 Replies View Related

How To Use Same Variables In Different Subs

Jun 4, 2009

I have 2 sub, and I want to use the same variables that reference values on my spreadsheet.

for instance, I declare and set ws as worksheet("sheet1") in the first sub.
in the second one, I also want to reference to the same ws. Instead of having to declare it twice, being redundant, what would be a good way to do this?

View 9 Replies View Related

Repeating The Subs

May 8, 2007

How can I have a sub repeat itself? I have a code and I want it to ask the user at the end if they would like to do it again. If so the whole sub needs to be repeated. I'm sure this has something to do with looping, but I don't know how to manage this.

View 3 Replies View Related

Prevent Sheet Change Macro When Solver Runs

May 26, 2009

Is there a way to prevent the Workbook_SheetChange event macro from triggering when I run Excel's Solver?

The solver goes through 100 or so iterations changing multiple cells each of which seemed to trigger the Workbook_SheetChange event. If there was a Solver Run event, I could turn off application events, but as far as I know such an event does not exist.

View 9 Replies View Related

Using Variables And Calling Subs

Aug 19, 2008

I'm having some trouble getting to grips with using/calling variables and other sub routines.

View 9 Replies View Related

Passing UDTs To Subs

Jan 26, 2009

I have created a few User Defined Types in a Main subroutine, but when I pass them into another sub the intelisense for the elements doesn't come up. I can type in the elements manually - and it all seems to work okay - but with a lot of types and elements I really want it to save me the effort.

View 2 Replies View Related

Passing Variables Between Subs?

Nov 3, 2009

I think I am confused as to how to declare a variable in one sub and use it as an input into another sub. I have attached some code below that assigns a value to two variables and then calls a sub that uses those values. I am brand new to programming so I guess I am confused how to implement this.

View 3 Replies View Related

VBA - Exit All Subs Not Just Current

Sep 10, 2012

VBA - Exit all Subs not just current

View 2 Replies View Related

Passing Variables Between Subs

Oct 30, 2013

I have some code I'm running:

Code:
Sub Main ()
Dim Value1 as integer
Value1=5
Call firstroutine
Call secondroutine
End Sub

[code].....

Somehow I need to pass Value1 & Value2 to secondroutine.

View 5 Replies View Related

Call Multiple Subs

Jul 28, 2007

Calling a Sub from another Sub is quite common, how about a Sub that does nothing else but call all the subs to execute the entire job?

Will the subs run sequentially after one completes, or will there be the likley hood they will bump into each other causing all sorts of chaos.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved