Activate Sheet And Disable Tabs On Open
Dec 6, 2008I am trying to create an event macro that would deactivate column and row headers when the workbook is launched and activate a sheet. i am not managing to do this,
View 2 RepliesI am trying to create an event macro that would deactivate column and row headers when the workbook is launched and activate a sheet. i am not managing to do this,
View 2 RepliesOn a command button in a userform, I have this code to open another workbook:
View 2 Replies View Relatedmy sheet tabs sometimes disappears when I open excel. I know you can go through the start button and the advanced option to display the sheet tabs. Is there code I can incorporate so that on the opening of the excel file after the splash screen runs its course, the sheet tabs are displayed.
View 9 Replies View RelatedI have two workbooks. One is a no-nonsense form interface that my bosses will use to enter safety information. I'll call this workbook "Form". This file is stored locally on each of their computers. The other workbook is stored on a common drive. I'll call it "Master".
When my bosses fill out the Form and click "Submit", the Master file is opened, and certain cells are populated based on information entered in the Form. This is the code I am using to make this happen:
I use a workbook where new worksheet tabs are added and removed daily. Every day I use the second-to-last tab (2nd from the right) and the last tab (far right). What code would enable me to activate and reference both of these tabs individually? I believe it would be something like the code below but I can't figure it out...
View 5 Replies View Relatedhow to make a MsgBox open anytime a cell in Column A was double-clicked--and the content of the MsgBox was from the cell in the same row in column Z. I've now realized the double-clicking isn't an ideal solution, as it's easy to click in another cell and mess up all the formulas.
(1) Code that deactivates the "edit directly in cell" option when the workbook is opened.
(2) Code that opens the MsgBox when a cell in Column A is clicked just once (or similarly less fool-proof than double-clicking or right-clicking).
I have 2 workbooks open
Book1 has a call to ChangeBook()
Book2 is empty
Function ChangeBook()
Application.Workbooks("Book2.xls").Activate
End Function
ChangeBook() is located in a .xla file loaded on Excel launch.
Calling the function from Book1 does not cause Book2 to activate.
Running the function via the F5 key in the IDE works fine.
I am modifying existing routines that have problems and being able to activate certain books at will would make the changes much easier.
I have a workbook containing macros that opens a second one (no macros) and does some 'data mining'.
The following VBA is used for that (I use this code on dozen of files and it has always worked, except here):
Set WshShell = CreateObject("WScript.Shell")
ChDir (WshShell.SpecialFolders("MyDocuments"))
BladNaam = Application.GetOpenFilename("Excel File, *.xls", , "Excel")
Workbooks.Open FileName:=BladNaam
TabNaam = ActiveSheet.Name
The problem is that most of the time the newly opened workbook is NOT activated (i.e put on top) and thus the rest of the code is executed on the wrong workbook...
If I put in a Msgbox(ActiveWorkbook.Name) 9 out of 10 times the active workbook is the initial one and not the one that was opened by the code.
tried replacing Active.Workbook with wb (dim wb as workbook).
tried to wait-a-few-seconds in between code
tried renaming
activate an open workbook based on the workbook name that is typed into a cell that is a named range?
So, I keep wanting to do this:
Windows.Activate Filename:=Range("MyRange")
Because this works:
Workbooks.Open Filename:=Range("MyRange")
I have a program that has all Excel Workbooks in seperate instances of Excel. There is a very sound reason for doing this.
The user has maybe 3 to 10 workbooks open. There are times when a workbook is active and has a Macro Link to open one of the already open workbooks.
When the user clicks the link, they naturally get an error message stating that the workbook is already open. Then they have to close the error msg and click on the Macrosoft Tab and look thru the list of open workbooks and then click the one they are looking for. Additionally, in this Menu Program the user really doesn't even have to know the name of the various workbooks.
I hope everyone will believe me when I state that this program works berautifully.
Right now I am simply cleaning up and making a few little things work better.
QUESTION When the user clicks on a macro link that is to open a workbook that is already open, how - On error - can I have the macro continue on and activate the requested workbook - - - Please remember they are all in separate instances of Excel.
Since the code I'm using can determine if the requested workbook is already open, I think there has to be a way to activate that workbook.
I have the VB Editor open and am manually activating different workbooks in Excel (with 20/25 modules each), the VB Editor goes through a process of maximising each and every module in the workbook I have selected before I can edit any code or, indeed, do anything in the workbook. This process takes about 8-10 seconds every time I select a different workbook in excel! I have played around with the settings "Full Module View" in the options section of the VB editor, but to no effect.
View 3 Replies View RelatedIs it possible to open a workbook via vba, but disable the macros? I know this sounds strange, but the workbook is coded to prevent users from saving it, and the only way to save it is to either open it with macros disabled or change the variable OKtoSave to true, but the variable is global only to the sheet and I can't find a way to change it through a macro written in my personal.xls workbook.
View 5 Replies View RelatedWhen I have a macro open another file, it always activates the macros in it. Is there some way to disable the macros?
View 11 Replies View RelatedI have a macro in a workbook template,that when the workbook is open it populates a cell with the date and time such as 111711.507. This becomes the contract number for this workbook.. They complete the form or workbook and save it. The next time they open the saved workbook the macro runs and changes the contract number to a new number. I want to disable the macro on the saved workbook from changing the number.
View 2 Replies View RelatedI have a model which extracts data from an external data sournce using an ODBC query. This data is then used to generate a pivot table. I have incorporated code to update the query and the pivot table on startup but would like to disable the Enable Query Refresh message box which occurs at startup (it would also be nice to disable the security warning but I know that is a no no)
View 2 Replies View RelatedIs there a way to remove the option to open a file as read only when the file is already open by another user? Ideally when a user tries to open a file that is already in use they would get a message to that effect and the only option at that point would be for them to select "notify" when file is available.
View 8 Replies View RelatedEvery day for each date of month I have to copy data from mails to my workbook and a last sheet named report in which I need last row value from 7 or 8 sheets for this I have developed following codes which seems to me very long procduer.
Code: ....
I have this code in Book1:
sub OpenCloseMacro1()
Workbooks.Open Filename:="E:closeopenBook2.xlsm"
Workbooks("Book1.xlsm").Close SaveChanges:=True
Application.Run ("Book2.xlsm!Macro1")
End Sub
It closes Book1 and saves it, it opens book2, but Macro1 does not activate. Why?
by the way. Macro1 is:
Sub Macro1()
Userform1.show
End sub
sub OpenCloseMacro1()
Workbooks.Open Filename:="E:closeopenBook2.xlsm"
Application.Run ("Book2.xlsm!Macro1")
Workbooks("Book1.xlsm").Close SaveChanges:=True
End Sub
It opens book2, and activates macro1, but Book1 is not closed
I want to activate the sheet based on my cell value but the prog is not working.
Sub emptest()
Dim tempname As String
Worksheets("team").Select
Range("c24").Select
Do While ActiveCell.Value ""
If ActiveCell.Value = tempname Then
Worksheets(tempname).Select
Else
MsgBox "no sheet"
End If
ActiveCell.Offset(1, 0).Select
Loop
End Sub
When I select a specific sheet I would like cell A1 to be selected using VBA.
View 2 Replies View RelatedI have workbook with two sheets "Path A" and "Path B". Whenever I activate worksheet "Path B", I want to activate the cell in "Path B " which was the active cell in sheet "path A". For example, if cell R1 was active in path A when Path B was activated, R1 should be made the activecell of Path B. Tried the follwing code... not working.
Private Sub Worksheet_Activate()
Dim r As Integer, c As Integer
r = Worksheets("Path A").ActiveCell.Row
c = Worksheets("Path A").ActiveCell.Column
Worksheets("PathB").Cells(r, c).Activate
End Sub
I need to batch open some hyperlinks from a long list of hyperlinks in my excel sheet. I would like these to each open in a new tab of my web browser. Is there a way to do this?
View 6 Replies View RelatedI have an index page with hundreds of worksheets (poor spreadsheet design i know) I am looking for a button to go next to the sheet name on the index sheet, read the cell in the button's macro code and when pushed go to that sheet's location. I can easily make a button to go to one sheet but with hundreds of sheets this becomes a monotonous task. Example
Index Sheet
Sheet 2 (Button) <-- Button reads the text, takes you to the "Sheet 2" location
Sheet 3 (Button)
Sheet 4 (Button
Sheet 5 (Button)
I have a button on a sheet which needs to remain protected.
However, the button code does not activate when the sheet is protected...
Any hints on how to "unprotect" just the button?
I have created a Group Box in Excel with 4 Option Buttons in the group. I have also created a Command Button which currently, when clicked, changes to a worksheet I specified. I am trying to have the Comand Button, when clicked, look at the selected Option Buttons in the Group Box and change to the worksheet specified by the selected Option Button. I have tried an IF..THEN statement with no success. code below that I have tried.
Private Sub CommandButton1_Click()
If AM40 = 1 Then
Sheets("Billboards(1)").Select
'ElseIf AM40 = 2 Then
' Sheets("Live Events Feedback(1)").Select
End If
End Sub
I have a UDF in Cell Sheet1!A1 that inputs some ranges from Sheet1 and calculates a number. Then I have a sub that calculates the value of this function with Evaluate(Sheet1!A1.formula). However, this only works when I am in Sheet1. Otherwise, I get the wrong calculation. How can I avoid this? I will post the code in the open source forum as it otherwise is quite good and automatically resizes array functions to their proper size.
View 2 Replies View RelatedI have several cells in a column for the user to input data, and then a "submit" button. It is a very basic sheet to take user input and store it on another sheet and then manipulate(pivot) and display(graphs) on respective sheets.
Is it possible to remove gridlines and disable all cells on the input sheet except for those that take input, currently validation cells. The main reason is when the user hits tab or lets say enter it moves to the next field for data entry as opposed to through the two empty cells between that are there for spacing. Also to disable them from editing the text that poses the questions(labels): "
I have seen all the past questions and answers on this subject but mine has a little twist to it.
I only want 1 sheet in 12 to disable CUTTING AND PASTING but I want the user to be able to COPY and PASTE VALUES ONLY in this sheet.
Is there a macro for this?
how can i disable "Cut" in a specific sheet for users?
View 3 Replies View RelatedI tried to disable users from printing the sheet
with this