Excel VBA help

Ads Patz

New Member
Joined
Jan 12, 2018
Messages
15
Hi All,

Everytime I record a Macro for some reason the first action is Delete. = even though i did not press delete while recording macro. This is is causing issues when I try to re run the macro. Can someone please why this happens?

Sub Macro2()
'
' Macro2 Macro
'


'
Delete. = "Hello"
ActiveCell.Offset(3, 0).Range("A1").Visible
End Sub
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
No This is the only macro. I have tried recording a macro again in another workbook and it has happened again. This has never happened before so I find it very strange.
Do you think it would have anything to do with the settings in Excel as this is the first time I have tried to record a macro on this laptop?
 
Upvote 0
I have never heard of such a thing. Very odd... It seems something is interfering with it. Not sure what that would be if it is happening in a new workbook too.
Do you have any Add-Ins installed?

Note, while not optimal, you can simply delete that line from your recorded macros. So there is a "workaround" (though it would be preferable to find out why and stop it).

If you do discover what is going, please be sure to post it back here. I am very interested in hearing how/why this keeps happening.
 
Upvote 0
How did the word "Hello" get into the macro? Did you type it there or was it automatically inserted?
 
Upvote 0
I typed the word hello.

So all i did was press record macro, type hello. stop recording macro.

Then i tried to re run the macro and an error came up asking me to debug the Delete. = "Hello".
 
Upvote 0
I typed the word hello.
In some cell, I presume?
You aren't then deleting that word before stopping the Macro Recorder, are you?

Are you also unhiding rows/cells?
Are there any cells/rows hidden to start?
You are not working off of a template, are you?
Trying doing a few other commands, and see if those get recorded too.

Due to this odd behavior, I would recommend running a virus scan too, just to make sure that your computer is not infected.
 
Last edited:
Upvote 0
Another point.
I've never seen a recorded macro with a line like this
Code:
ActiveCell.Offset(3, 0).Range("A1").Visible
 
Upvote 0
Another point.
I've never seen a recorded macro with a line like this
Yes, that is a bit odd. That is one of the reasons why I recommended the following:
Trying doing a few other commands, and see if those get recorded too.
I want to see if maybe they are not looking at the right macro.

Ads,
To make sure that you are looking at the correct code, when you start recording the Macro, give it a distinct name (i.e. "AdsMacro"). That way, when you view the VBA code, you can be sure that you are looking at the right macro (and you aren't looking at some existing macro you may have stored in your Personal Macro Workbook).
 
Upvote 0
Nope the only thing I am doing is recording, typing hello and then stop recording.

Excel version 2013.

Have tried adding formulas and coloring cells but still an issue.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top