View Single Post
 
Old 01-30-2015, 04:53 AM
HalfNOoB HalfNOoB is offline Windows 7 32bit Office 2007
Novice
 
Join Date: Jan 2015
Posts: 2
HalfNOoB is on a distinguished road
Default Selection.Interior cause runtime error

Hi guys

I've recently created an automatised Holiday list for my Enterprise. The Command Buttons were working fine and you could select the range and set the Color for the cell by pressing the button. But for some reason it doesnt work anymore today.

Theres an error saying something like application- or objectdefined error with the runtimeerror number 1004.

Do you have any idea what the Problem could be and how to fix it? I've read on the Internet that Excel has Problems with selection and multiple Registers/Tabs, so maybe ist somehow related to this.

Sorry about my english, the Translation of the error is just some Translation i came up with... However, the Compiler Points to the Selection function of the button pressed.

Here's the code I use for every button:

Code:
Private Sub cmdFerienFeb_Click()
   Selection.Interior.ColorIndex = 3
   Call CountNotAbsentFebruary
End Sub

EDIT: the macro is working just fine

Thanks for your suggestions

HalfNOoB
Reply With Quote