macros

Forum home » Delegate support and help forum » Microsoft Excel Training and help » How do I fix my Excel macro?

How do I fix my Excel macro?

resolvedResolved · Low Priority · Version 2010

Steven has attended:
Excel Advanced course

How do I fix my Excel macro?

What would be the typical procedure to follow if a Macro I ran wasn't working, and noone in the office was able to fix it?

RE: Macros

Hi Steven,

Thank you for your question and welcome to the forum.

When you record a macro in the front end of Excel to automate a process, the VBA application is recording each instruction you give it as a separate line of code in a procedure in a module.

If a macro is not working you will probably get an error box possibly displaying a runtime error number. If you click debug it will take you into the VBA window and display the code that was written when you recorded the macro. It will generally highlight the offending code in yellow which will need to be edited and changed.

To change the macro you have to edit the code or repeat recording the macro in the front end until you get it right.

If you want to view the VBA code then use ALT + F11. Alternatively, if you get an error number then google that error number e.g. vba error number 1004.

I hope this helps.

Regards

Simon

Thu 24 Nov 2011: Automatically marked as resolved.


 

Excel tip:

Importing Numbers in Excel 2010

Occasionally, when importing data into Excel you find that the some of the imported values are treated as text.

To convert these numbers to actual values, click on an empty cell and press Ctrl+C.

Next, select the range that contains the values you need to change and in the Clipboard Group on the Home tab, click the Paste drop-down arrow and choose Paste Special. In the Paste Special dialog box, select Add and then click OK.

View all Excel hints and tips


Server loaded in 0.16 secs.