Share via

Excel. Deleted code still running

Anonymous
2012-04-24T15:02:51+00:00

My Excel workbook had two sheets. Both sheets had vba code behind them. I combined the sheets. Copied vba code from sheet 2 to sheet1 and delete sheet 2. I had to change a great part of the code that was behind sheet 2 (especially cell references) so it works with sheet 1.

When I run the code it still uses some old code that was behind sheet 2 that was deleted.

Example: In the new code I put string in cell R10 in lowercase. The old code put string in cell A10 in uppercase. When I run the code the string appears in cell R10 and cell A10 and both appears in uppercase.

Also I get strange behavior when sorting via vba sort method.

I double check the code and re-compile it with the same result.

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

Answer accepted by question author

Anonymous
2012-04-24T15:26:19+00:00

Hi,

  1. All codes (macros) are in Modules, not on(in-behind) Sheets.

(unless you mean:

vba private sub that can be called from sheet1 or sheet2

If so, right click on sheet1 tab, select View code and edit private sub...)

or

  1. press Alt+F8 to edit each macro separately.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful