1
    _Sheet.Rows("1:1").Select
    With _Excel.ActiveWindow
        .SplitColumn = 0
        .SplitRow = 1
    End With
    _Excel.ActiveWindow.FreezePanes = True

This is my code right now and I can't figure out how to deselect the active row in my excel sheet when saved.

Any help is awesome!

  • 4
    Why do you select it to begin with? – Pspl Feb 08 '19 at 15:06
  • 2
    [This](https://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba) could be useful – cybernetic.nomad Feb 08 '19 at 15:07
  • 2
    Something HAS to be selected in excel, so just select something else. Although I 100% agree with @pspl as there is no reason to `.Select` in the first place. Just remove that line. – JNevill Feb 08 '19 at 15:10
  • 1
    Or, simply add `_Sheet.Cells(1,1).Select` to the end. – BruceWayne Feb 08 '19 at 15:12
  • I have to select a row because I want to freeze it so when you scroll it always shows. –  Feb 08 '19 at 15:13
  • Nevermind you guys were right I just removed the _Sheet.Rows("1:1").Select and it worked. My apologies –  Feb 08 '19 at 15:16
  • 1
    That's the trick with `.Select` in VBA. The only time it's really needed is at the end of a routine to place the cursor on a particular cell for the user. That link that @cybernetic.nomad provided is a good read about this topic if you plan on doing more vba – JNevill Feb 08 '19 at 15:27
  • Awesome Thanks guys! –  Feb 08 '19 at 15:45

0 Answers0