I 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 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.
I have a protected worksheet with some macros running on it, and I have been requested to make the workbook shared. Trying to implement this, I keep getting the standard "1004 You cannot use this command on a protected sheet" error when applying an autofilter.
Here is what is making this problem a little tricky:
- As the workbook is shared, I cannot do Protect UserInterfaceOnly because you can't change the protection settings on a shared workbook without unsharing it. Needless to say, I cannot unshare the workbook.
- When I protect the sheet, I do allow the user to use autofilter. Consequently, Sheet.Protection.AllowFiltering and Sheet.EnableAutofilter both are on. Still, I keep getting the error.
where shData is the codename of the sheet, lngField is the number of the field and strArg is the filtering criteria.
My guess is, that the error comes from the fact that (for some silly reason) in VBA the .AutoFilter method is used to create a new filter, not only to use an existing one. The members of Sheet.AutoFilter.Filters collection are read-only, and cannot be used to modify the existing filter.
I want to click a specific button on a webpage but there is different buttons with same name (in view source) but tabindex is different.I want to click a button where tabindex = 7.
I've developed a little software using Excel Macros & VB. To prevent people from accesing the code I protected the code blocking it from visualization. It seems not enough as an acquaintance of a friend cracked it in 25 minutes. Or so he says. So I'd like to know if there is a better way to protect the font code.
I am trying to write a macro that activates the following funtion in cell D1.
=HYPERLINK("#"&C2,"")
I have recorded the following macro but it only jumps to the cell the function is in rather than actually activating the function and jumping to reference which has been selected in C2.
I know that I can assign a keyboard shortcut to run a macro, but I have multiple items that are activated by command buttons and would like to be able to trigger them all with one keystroke.
I have a number of buttons on a daashboard that run different macros.
Is it possible to have the most of the buttons deactivated until a cell on a different sheet has a value in the there (Text or number) turning them active?
This works fine, my only problem is if the button that is created is actually named Button2 or 3, etc. Is there a way to assign the new button to a variable, or would it be an object? this way it wouldn't matter what it was named.
i have a button that copies data from cell A5:K5, and pastes it in Sheet2 of my workbook.
The data is ordered like this
------ ------ ------ button1
------ ------ ------ button2
------ ------ ------ buttonX
I have like 40 buttons attached to 4 rows each. And in that group of rows, i have some cells with an IF= formula, and some minor coding. The problem is: If i press button 3,4,17,29 before i press every other button before that. I get an reference code fail at the cell.
If i press the buttons in order. Like 1,2,3,4,5,6,7 - it appears smoothly.
More info: The button copies data from for example A5:K5 and pastes it into the next blank row of sheet2. But i want to be able to press button 2 before i press button1, without getting an error in my =IF cell.
If i press the 40 buttons in a row, and then starts to mix up the button pressing. It appears smoothly.
I have developed a Userform button in Excel 2010 using the developer icons, which when clicked on with my mouse it runs my super dooper macro. It works great!
But one thing I want to have happen is to have the choice of using the Enter key to start the macro or use the left mouse button
For example, I place data in (say) cell A1 and the userform button is in cell A2. When I place the data in A1 and press the Enter key, the cursor moves down to A2, but doesn't highlight the user button. When I press the Enter key again, the cursor moves to cell A3.
What I want is when I fill in the data in A1 and press the Enter key, the cursor moves to cell A2 and selects the button, so that when I press the Enter key again, it activates the macro.
I'am trying to make a button that will let me send a email via outlook. trick is work book is password protected but need to send some of the data contained to perssonel that dont have the password so sending teh complete work book doesnt work just need something simple. I have learned all ( little) i know from reading and searching here.
no links to other sites as my firewall here at work will possibly reject it
I wrote code to update some workbooks. The code opens the workbooks and then activates the workbook to add the update.
I was tired when I wrote the code to activate the workbook and it is written:
Workbooks("Update").Activate
The updates have already been sent out and it is not working on some computers. (If I change the code to
Workbooks("Update.xls").Activate
it works fine.)
Is there some option in the VBA editor that I can have people change on their computer so the code will run? Why does it work on some computers and not others?
(Unfortunately, rewriting the code to add ".xls" and resending everything isn't an option.)
I am writing a code that has a sheet change event linked to call on a number of macros. The vba works fine until I change another cell and it activates the same macro.
VB:
Private Sub Workbook_SheetChange(ByVal sh As Object, ByVal Target As Range
Select Case Range(BI47) Case "1"
[Code]....
I have tried if statements and everything else I can find, most will not work, others report errors. The code and macros will be the same on many sheets but work independently and BI27 is the source of the change
I have this code below, which someone from this forum kindly kindly gave to me for my Worksheet code. What it does is check the value in a dropdown list in column I and if it says "Cancelled" then strikethrough columns A-K of that row.
What I wanted to know is this, in cell N2 has the formula to show todays date. In column D9 onwards is an end date. How can I amend the code below so that it also checks to see if the date in Column D9 onwards is greater than N2 and if so strikethrough columns A-K in that row?
Would it be in the form of an OR statement in the code below?
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...
Every 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.
I am using Excel 2010 and I have a password protected workbook with password protected sheets that uses several macros. Most of them, in order to run, have to un-protect the sheet and then re-protect it again. This has been accomplished easily enough by adding ActiveSheet.Unprotect Password:= "mypassword" and ActiveSheet.Protect Password:= "mypassword" to the appropriate places in the script. All of my macros, which do various things like sorting and moving data, deleting blank rows, displaying dialog boxes containing warning messages etc. run fine.
My problem is this: when I password protect the sheets manually, I have checked the following options in the "Protect Sheet" dialog box. Under "Allow users of this worksheet to" I have checked 1)Select unlocked cells and 2)Format cells. After entering my password and closing the dialog box my sheet is protected, but I can edit cells in the manner my allowances permit. However, once I run any of the macros that un-protect and re-protect the sheet, I remain able to select and edit unlocked cells (practically, for my purposes, this means that I can input data which will appear in the default font size and color of the sheet) but I cannot format cells (which, practically, for my purposes would allow me to occasionally change the font color and size of the data). Naturally, after running a macro, the other cell-formatting options are unavailable to me as well. Is there any way to get my manual selections to remain in place after running a macro that functions as mine do? Or is there any way to make my manual selections the default settings for a protected sheet?
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
I 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 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,