Excel 2007, Protected Sheet: Runtime Error '1004' Unable to set the HorizontalAlignment property of the Range class

Anonymous
2010-09-13T23:40:13+00:00

I have a spreadsheet that I would like to have a button that people can click that will add a row similar to the one above it. It works ok when the spreadsheet is unprotected, but once I protect it I get the Run-time error.

The macro inserts a row; merges and centers A42-D42, F42-I42, K42-U42, W42-AB42, AD42-AG42, AI42-Al42; underlines each of these sections, then returns to A42.

Also, how can I get the macro to insert the row after the row that I am currently on instead of the row that I recored it on?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Oldest
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more