Re: Delete Worksheet If It Exists
It's not that the code bugs exactlly, it just doesn't delete the sheet. The code after that (which inserts a new sheet called "Cleaned") bugs.
Re: Delete Worksheet If It Exists
It's not that the code bugs exactlly, it just doesn't delete the sheet. The code after that (which inserts a new sheet called "Cleaned") bugs.
Re: Delete Worksheet If It Exists
Nope. No Luck. I thought it might help to make a seperate sub and run it from the other code but that didn't help either.
Re: Delete Worksheet If It Exists
That looks like it just might work. I'll try tomorrow when I get in to work and let you know. Thanks a lot!
Re: Delete Worksheet If It Exists
I can't have it delete the sheet at the end otherwise it defeats the purpose of the code that is running. "Cleaned" are the results that I need to look at.
Re: Delete Worksheet If It Exists
Do you mean changing ws to Clnd?
Attached is the file & all code.
Does anyone have SIMPLE code for this that can be run in a normal Sub. My worksheet will always be named "Cleaned". I have seen some posts regarding Functions and other things that seem more complicated than necessary.
Thanks.
Re: Delete Row When Cell Not Equal To Another
Thanks Roy.
The code below is an attempt to delete all rows where the cell in column A is not equal to the value of B1. B1 is text if that somehow makes a difference.
Dim n As Long, lastrow As Long
lastrow = Range("A65536").End(xlUp).Row
For n = lastrow To 1 Step -1
If Cells(n, 1) <> Range("B1") Then Cells(n, 1).EntireRow.Delete
Next n
Do I need to specify that B1 will always be the cell to reference (ie $B$1).
Thanks for the help.
Edit: Just had an epiphany, I also need it to stop after Row 3. I have some headers and such that I don't want removed. Any help there would be appreciated.
Re: Hide Blank Rows From Bottom Up
Perfect, thanks a lot!
The following is code that I have to hide all the rows beneath the last row containing data. The only problem is it hides that last row of data also. I don't want it to hide that last row of data, how can I make it not?
Re: Option Button Name Changes When Copied To New Worksheet
It's a control option button that I'm copying through code. The names is one thing when copied, then when pasted on another sheet, the pasted option button name changes.
Re: Run Code On Cell Change On Separate Worksheet
I ended up deleting it because I found a work around, but I still don't think it had to do with what the code was bacuase it would work if I changed the value manually while on the worksheet, but while changing the value from the other sheet it wouldn't. Sorry that I don't have the code anymore.
I have two option buttons (Designerbutton1 & Designerbutton2), when I copy them and paste them to a different worksheet their names change to Optionbutton# (# = next available number). Anyone know why & if I can prevent this. I cannot have a code that says Optionbutton16 should be renamed to what I want it to, because right now 16 is the next available # but what if I add an Optionbutton16 later on my own.
Re: Run Code On Cell Change On Separate Worksheet
Norie -
The code does nothing at all, it doesn't run. I assumed it's because the sheet inactive.
Maybe my code is whack. I do know that I have some issues that I need to ammend - however, since the code is wrong, if it was running then the debugger should pop up, right?
Re: Dont Find Control On Form
did you detele some cells when you noticed this? You may have it still there just on top of another control. You should try selecting a control nearest it name but before it not after. ie - say optionbutton20 is what you're looking for, try selecting optionbutton19, 17, 15 somewhere near there, then press tab till you come upon optionbutton20.
I have several option buttons linked to cells on a separate worksheet. Once one of the option buttons is chosen, the cell value changes. When that cell value changes I want it to run code. However, when using the Worksheet_Change method that becomes an issue due to the fact that the worksheet isn't active. Any suggestions?
Thanks,
Ed
Re: Remove .xls From Header
That does work if I open the attachment, but if I save the file to my drive, it pops back up. What did you mean by xl200? Did you mean the 2000 version? If so, I believe that I have 2000.
Re: Remove .xls From Header
Sorry for not being clear enough. If you went to the view menu, you could find Header and Footer...
In there if you do a custom header as "&[file]", it gives you the workbook name.xls, that's what I don't want shown.
Thanks again.
Anyone know how to remove the .xls from the header when using the the &[file] automatic method of gaining the file name?
Thanks