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
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,834
Messages
5,855,898
Members
431,772
Latest member
dannyboi1

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
Top