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

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
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
 
Upvote 0

Forum statistics

Threads
1,213,539
Messages
6,114,221
Members
448,554
Latest member
Gleisner2

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
Back
Top