ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   What does undersocre line mean (https://www.excelbanter.com/excel-programming/300678-what-does-undersocre-line-mean.html)

Grace[_4_]

What does undersocre line mean
 
In a lot of these macros, I see an underscore "_" symbol. What does it
connote?

G



Chip Pearson

What does undersocre line mean
 
Grace,

That is a line continuation character, which is used to write one
logical line of code on several actual lines of code in the file.
It is used on long lines of code to make to make the code more
readable.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Grace" wrote in message
...
In a lot of these macros, I see an underscore "_" symbol. What

does it
connote?

G





pikus

What does undersocre line mean
 
When it's used at the end of a line it is a line-continuation character
It means that the code on that line and the line that follows i
treated as though it is on the same line. I't is for asthetic reason
as it makes code easier to read. At least it does when it is use
properly. - Piku

--
Message posted from http://www.ExcelForum.com


Trevor Shuttleworth

What does undersocre line mean
 
Grace

you can't have spaces in labels and variable names, etc. Using an
underscore is a common way of "breaking up" the variables to make them more
readable. Some people use capital letters as another option.

So, if you had a macro that you wanted to call "copy data from sheet 1 to
sheet 2" you could write:

Sub copy_data_from_sheet_1_to_sheet_2()

or

Sub Copy_Data_From_Sheet_1_To_Sheet_2()

or

Sub CopyDataFromSheet1ToSheet2()

Regards

Trevor


"Grace" wrote in message
...
In a lot of these macros, I see an underscore "_" symbol. What does it
connote?

G





William[_2_]

What does undersocre line mean
 
Grace

You are breaking up one line of code into more than one line to make it
easier to read. So....

Range(Range("A1"), Range("A" & Rows.Count).End(xlUp)).Select

is the same as

Range(Range("A1"), _
Range("A" & Rows.Count).End(xlUp)).Select

--
XL2002
Regards

William



"Grace" wrote in message
...
| In a lot of these macros, I see an underscore "_" symbol. What does it
| connote?
|
| G
|
|



Harald Staff

What does undersocre line mean
 
Hi G

It (a space plus an underscore) wraps a long line, meaning something like
"this is not a line break". As in

Hi _
G

One does this
1) because one can not afford a super widescreen display on a developer
salary;
2) because newsgroup postings break long lines automatically, making
copy-paste code err.

HTH. Best wishes Harald

"Grace" skrev i melding
...
In a lot of these macros, I see an underscore "_" symbol. What does it
connote?

G





Grace[_4_]

What does undersocre line mean
 
Wow, I sure got a lot of help on this one. Can I ask any of you to look at
the reply I sent on "can it be done" and see if any of you can answer any
(doesn't have to be all) of that?

Thanks, _
Grace

"Harald Staff" wrote in message
...
Hi G

It (a space plus an underscore) wraps a long line, meaning something like
"this is not a line break". As in

Hi _
G

One does this
1) because one can not afford a super widescreen display on a developer
salary;
2) because newsgroup postings break long lines automatically, making
copy-paste code err.

HTH. Best wishes Harald

"Grace" skrev i melding
...
In a lot of these macros, I see an underscore "_" symbol. What does it
connote?

G







Dave Peterson[_3_]

What does undersocre line mean
 
You have another reply there.

Grace wrote:

Wow, I sure got a lot of help on this one. Can I ask any of you to look at
the reply I sent on "can it be done" and see if any of you can answer any
(doesn't have to be all) of that?

Thanks, _
Grace

"Harald Staff" wrote in message
...
Hi G

It (a space plus an underscore) wraps a long line, meaning something like
"this is not a line break". As in

Hi _
G

One does this
1) because one can not afford a super widescreen display on a developer
salary;
2) because newsgroup postings break long lines automatically, making
copy-paste code err.

HTH. Best wishes Harald

"Grace" skrev i melding
...
In a lot of these macros, I see an underscore "_" symbol. What does it
connote?

G





--

Dave Peterson



All times are GMT +1. The time now is 01:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com