Home > Software engineering >  Record Macro isn't recording ".select" step
Record Macro isn't recording ".select" step

Time:01-13

I'm working with macros in 2 different computers, the one I take to the office has this issue where I record a series of steps and by the time I use the Macro it is not working. I tried every single step by its own and the problem seems to be that the .Select step, where I select a cell after a copy process, isn´t been recorded:

THIS IS WHAT SHOULD'VE BEEN RECORDED:

Sub Macro1()
'
' Macro1 Macro
'

'
    Range("D5:D7").Select
    Selection.Copy
    Range("F5").Select
    ActiveSheet.Paste
    Range("H7").Select
    Application.CutCopyMode = False
End Sub

THIS IS WHAT HAS BEEN RECORDED:

Sub Macro1()
'
' Macro1 Macro
'

'
    Range("D5:D7").Select
    Selection.Copy
    ActiveSheet.Paste
    Application.CutCopyMode = False
End Sub

I've tested this on both computers and with the same document and different ones, only happends on the computer I take to work. Then I tryed reinstaling Office, not fixing the problem either. TY for help.

CodePudding user response:

If you select a cell but do not do anything else with that cell, the Macro Recorder will not record the step. Nothing is wrong with your recorder.

As other users have pointed out, this is a blessing in disguise as using the .Select method will both lengthen your code blocks, and run time.

CodePudding user response:

Reinstalled Windows, problem is fixed, ty for nothing :P

  •  Tags:  
  • Related