![]() |
|
#1
|
||||
|
||||
|
Hi. I have a workbook with a macro that fills the active cells. When I locked all the formulae to prevent them from inadvertent edits, the "Run time error 1004" appears everytime I go to unlocked cells.
My knowledge of vba and macro is to google, copy, paste, and record so I am at a loss on how to remove the error. Thank you for the usual quick help. |
|
#2
|
||||
|
||||
|
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Me.Protect UserInterfaceOnly:=True, AllowFormattingCells:=True Cells.FormatConditions.Delete Target.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" Target.FormatConditions(1).Interior.ColorIndex = 40 End Sub |
|
#3
|
||||
|
||||
|
Perfect. Again, big big thanks p45Cal. Had you not come to the rescue, my last resort would be to delete the highlight code.
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Suddenly having trouble using .Refresh BackgroundQuery. Error 1004, General ODBC Error | PLSBRYDOBOY | Excel Programming | 0 | 08-30-2019 12:17 PM |
Error 1004 on EnvelopeVisable
|
mamies | Excel Programming | 4 | 03-01-2017 05:14 PM |
| Run Time Error '1004' | galkej | Excel | 0 | 02-03-2014 06:39 AM |
Run-time error '1004': Document not saved. The document may be open...
|
doctor_who12 | Excel Programming | 1 | 01-22-2014 04:47 PM |
Run time error 1004
|
yonasan | Excel Programming | 3 | 06-12-2012 11:08 PM |