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

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

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,112,883
Messages
5,543,019
Members
410,583
Latest member
gazz57
Top