ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   table column name with newline, cannot select with string (https://www.excelbanter.com/excel-programming/449838-table-column-name-newline-cannot-select-string.html)

[email protected]

table column name with newline, cannot select with string
 
I have a 2010 excel table where a column name contains a newline.

While I can access this column using an index number I can't using a string.

I've tried

s = "Rotor" & vbnewline
s = "Rotor" & chr(13)

Is this possible or must the newline be remove. This newline was created
with the keycombo Alt-Enter

Fails:
ListObject.ListColumns(s).Index

Thank you

GS[_2_]

table column name with newline, cannot select with string
 
I have a 2010 excel table where a column name contains a newline.

While I can access this column using an index number I can't using a
string.

I've tried

s = "Rotor" & vbnewline
s = "Rotor" & chr(13)

Is this possible or must the newline be remove. This newline was
created with the keycombo Alt-Enter

Fails:
ListObject.ListColumns(s).Index

Thank you


The result of using Alt+Enter does not insert a linefeed or carriage
return+linefeed into the cell. It merely displays the content on a new
line. That means the cell contains "Rotor" only. If you entered the
following...

Rotor
Blade

...the cell will contain "RotorBlade".

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion




All times are GMT +1. The time now is 12:42 AM.

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