Help understanding VB code

Joolakker

New Member
Joined
Sep 19, 2006
Messages
7
Hi,

Probably a very simple question. I'm a novice with VB and usually record a macro and then amend the code to make use of variables. In the following example of "pre-recorded" code:

Selection.Sort Key1:=Range(n), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

You'll notice between "xlYes," and "OrderCustom" there is a "_ ". What is this? What does it do/ mean?

Thanks
 

Some videos you may like

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

DominicB

Well-known Member
Joined
Oct 3, 2005
Messages
1,569
Good afternoon Joolakker

First of all, and this is very important, its a " _", ie space followed by underscore. What does it mean? Nothing really, except that the code continues on another line, so the line can be shown as two lines (to aid readability) or be left as one long line which means you have to scroll horizontally along the VBE window to see the full line. If you want to show it on one line, delete the " _".

HTH

DominicB
 

Watch MrExcel Video

Forum statistics

Threads
1,118,193
Messages
5,570,783
Members
412,340
Latest member
nikitesh95
Top