ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Another to get hard returns in instead of: " & Chr(10) & " (https://www.excelbanter.com/excel-programming/401702-another-get-hard-returns-instead-chr-10-a.html)

StargateFanFromWork[_3_]

Another to get hard returns in instead of: " & Chr(10) & "
 
When I've recorded a macro with text and have done the ^+Enter, the macro
records that as " & Chr(10) & ". The macros I have that do this have
worked for years without any problems. But here, in this new contract,
weird stuff is happening. I now get the error:

"Compile error: Can't find project or library"

The "Ch" in the above " & Chr(10) & " is then shown highlighted in dark
great and the title for the macro is highlighted in yellow.

What can we use in place of ^+Enter to create a hard return in a cell via a
macro, and so that " & Chr(10) & " isn't needed?

Thanks. :oD



Frederik[_3_]

Another to get hard returns in instead of: " & Chr(10) & "
 
Use vbCr instead of Chr(10) to create a hard return.

"StargateFanFromWork" schreef in bericht
...
When I've recorded a macro with text and have done the ^+Enter, the macro
records that as " & Chr(10) & ". The macros I have that do this have
worked for years without any problems. But here, in this new contract,
weird stuff is happening. I now get the error:

"Compile error: Can't find project or library"

The "Ch" in the above " & Chr(10) & " is then shown highlighted in dark
great and the title for the macro is highlighted in yellow.

What can we use in place of ^+Enter to create a hard return in a cell via
a macro, and so that " & Chr(10) & " isn't needed?

Thanks. :oD




Peter T

Another to get hard returns in instead of: " & Chr(10) & "
 
Very likely you have a missing reference, in Tools / References look for a
ref marked MISSING.

As a short term fix to get out of trouble until the ref is solved try

VBA.Strings.Chr$(10)
or
VBA.Constants.vbLf

Regards,
Peter T

"StargateFanFromWork" wrote in message
...
When I've recorded a macro with text and have done the ^+Enter, the macro
records that as " & Chr(10) & ". The macros I have that do this have
worked for years without any problems. But here, in this new contract,
weird stuff is happening. I now get the error:

"Compile error: Can't find project or library"

The "Ch" in the above " & Chr(10) & " is then shown highlighted in dark
great and the title for the macro is highlighted in yellow.

What can we use in place of ^+Enter to create a hard return in a cell via

a
macro, and so that " & Chr(10) & " isn't needed?

Thanks. :oD





Rick Rothstein \(MVP - VB\)

Another to get hard returns in instead of: " & Chr(10) & "
 
Use vbCr instead of Chr(10) to create a hard return.

I think you meant to type vbLf , not vbCr.

Rick

StargateFanFromWork[_3_]

Another to get hard returns in instead of: " & Chr(10) & "
 
Knew there had to be some reason why it's worked everywhere but here. Well,
I took a look in the Tools References of the VBE and the only thing that I
could see out of the list that says "missing" is

MISSING: Microsoft Calendar Contro 9.0

which seems odd. But it's missing. And this references a missing OCX
called MSCAL.OCX. Does this govern something as simple as "carriage
returns" <g?

At any rate, tried the alternative suggested of vbCr even though I never
have much luck with that one. Sure enough, only got a little box.
So hunted around for what has worked before (I don't have too many VB
message boxes so took me some time to find). I subsbituted the vbCr with
vbCrLf and even though I still get a little box, I at least get a carriage
return inside the cell which is what counts. Fortunately, all this involves
tips or help information that I have assigned as macros to buttons on my
Excel.xlb to give me easy access to 4 things I use over and over and saves
me hunting them down, so the little boxes are a nuisance, but I can live
with them until I fix this problem.

Any suggestions on how to fix this, as I must admit I haven't an idea how to
fix (unless it's the missing MSCAL.OCX that's the culprit and hunting that
down).

Thanks. :oD

"Peter T" <peter_t@discussions wrote in message
...
Very likely you have a missing reference, in Tools / References look for a
ref marked MISSING.

As a short term fix to get out of trouble until the ref is solved try

VBA.Strings.Chr$(10)
or
VBA.Constants.vbLf

Regards,
Peter T

"StargateFanFromWork" wrote in message
...
When I've recorded a macro with text and have done the ^+Enter, the macro
records that as " & Chr(10) & ". The macros I have that do this have
worked for years without any problems. But here, in this new contract,
weird stuff is happening. I now get the error:

"Compile error: Can't find project or library"

The "Ch" in the above " & Chr(10) & " is then shown highlighted in dark
great and the title for the macro is highlighted in yellow.

What can we use in place of ^+Enter to create a hard return in a cell via

a
macro, and so that " & Chr(10) & " isn't needed?

Thanks. :oD







StargateFanFromWork[_3_]

Another to get hard returns in instead of: " & Chr(10) & "
 
"Rick Rothstein (MVP - VB)" wrote in
message ...
Use vbCr instead of Chr(10) to create a hard return.


I think you meant to type vbLf , not vbCr.

Rick


Oh, there. That _does_ work. Better than what I tried. I get the carriage
returns but no boxes. Yeay!! :oD



Chip Pearson

Another to get hard returns in instead of: " & Chr(10) & "
 
Whenever any library is missing in the list of reference, any other function
in any other referenced library can be "not found" by the compiler. It is
as if a single missing reference screws up the entire system of typelibs.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"StargateFanFromWork" wrote in message
...
Knew there had to be some reason why it's worked everywhere but here.
Well, I took a look in the Tools References of the VBE and the only
thing that I could see out of the list that says "missing" is

MISSING: Microsoft Calendar Contro 9.0

which seems odd. But it's missing. And this references a missing OCX
called MSCAL.OCX. Does this govern something as simple as "carriage
returns" <g?

At any rate, tried the alternative suggested of vbCr even though I never
have much luck with that one. Sure enough, only got a little box.
So hunted around for what has worked before (I don't have too many VB
message boxes so took me some time to find). I subsbituted the vbCr with
vbCrLf and even though I still get a little box, I at least get a carriage
return inside the cell which is what counts. Fortunately, all this
involves tips or help information that I have assigned as macros to
buttons on my Excel.xlb to give me easy access to 4 things I use over and
over and saves me hunting them down, so the little boxes are a nuisance,
but I can live with them until I fix this problem.

Any suggestions on how to fix this, as I must admit I haven't an idea how
to fix (unless it's the missing MSCAL.OCX that's the culprit and hunting
that down).

Thanks. :oD

"Peter T" <peter_t@discussions wrote in message
...
Very likely you have a missing reference, in Tools / References look for
a
ref marked MISSING.

As a short term fix to get out of trouble until the ref is solved try

VBA.Strings.Chr$(10)
or
VBA.Constants.vbLf

Regards,
Peter T

"StargateFanFromWork" wrote in message
...
When I've recorded a macro with text and have done the ^+Enter, the
macro
records that as " & Chr(10) & ". The macros I have that do this have
worked for years without any problems. But here, in this new contract,
weird stuff is happening. I now get the error:

"Compile error: Can't find project or library"

The "Ch" in the above " & Chr(10) & " is then shown highlighted in dark
great and the title for the macro is highlighted in yellow.

What can we use in place of ^+Enter to create a hard return in a cell
via

a
macro, and so that " & Chr(10) & " isn't needed?

Thanks. :oD








Peter T

Another to get hard returns in instead of: " & Chr(10) & "
 
Just to add, for some reason functions from the Strings and DateTime
libraries are particularly susceptible to being 'lost', unless fully
qualified.

At any rate, tried the alternative suggested of vbCr


Actually I suggested
VBA.Constants.vbLf

Regard,
Peter T


"Chip Pearson" wrote in message
...
Whenever any library is missing in the list of reference, any other

function
in any other referenced library can be "not found" by the compiler. It is
as if a single missing reference screws up the entire system of typelibs.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"StargateFanFromWork" wrote in message
...
Knew there had to be some reason why it's worked everywhere but here.
Well, I took a look in the Tools References of the VBE and the only
thing that I could see out of the list that says "missing" is

MISSING: Microsoft Calendar Contro 9.0

which seems odd. But it's missing. And this references a missing OCX
called MSCAL.OCX. Does this govern something as simple as "carriage
returns" <g?

At any rate, tried the alternative suggested of vbCr even though I never
have much luck with that one. Sure enough, only got a little box.
So hunted around for what has worked before (I don't have too many VB
message boxes so took me some time to find). I subsbituted the vbCr

with
vbCrLf and even though I still get a little box, I at least get a

carriage
return inside the cell which is what counts. Fortunately, all this
involves tips or help information that I have assigned as macros to
buttons on my Excel.xlb to give me easy access to 4 things I use over

and
over and saves me hunting them down, so the little boxes are a nuisance,
but I can live with them until I fix this problem.

Any suggestions on how to fix this, as I must admit I haven't an idea

how
to fix (unless it's the missing MSCAL.OCX that's the culprit and hunting
that down).

Thanks. :oD

"Peter T" <peter_t@discussions wrote in message
...
Very likely you have a missing reference, in Tools / References look

for
a
ref marked MISSING.

As a short term fix to get out of trouble until the ref is solved try

VBA.Strings.Chr$(10)
or
VBA.Constants.vbLf

Regards,
Peter T

"StargateFanFromWork" wrote in message
...
When I've recorded a macro with text and have done the ^+Enter, the
macro
records that as " & Chr(10) & ". The macros I have that do this have
worked for years without any problems. But here, in this new

contract,
weird stuff is happening. I now get the error:

"Compile error: Can't find project or library"

The "Ch" in the above " & Chr(10) & " is then shown highlighted in

dark
great and the title for the macro is highlighted in yellow.

What can we use in place of ^+Enter to create a hard return in a cell
via
a
macro, and so that " & Chr(10) & " isn't needed?

Thanks. :oD










StargateFan[_3_]

Another to get hard returns in instead of: " & Chr(10) & "
 
On Mon, 26 Nov 2007 22:02:27 -0000, "Peter T" <peter_t@discussions
wrote:

Just to add, for some reason functions from the Strings and DateTime
libraries are particularly susceptible to being 'lost', unless fully
qualified.

At any rate, tried the alternative suggested of vbCr


Actually I suggested
VBA.Constants.vbLf


There was another post suggesting just vbCr, not yours here <g. I
actually don't know how to use the VBA.Constants. bit, so just went
with what I know. Thanks. :oD

Regard,
Peter T


"Chip Pearson" wrote in message
...
Whenever any library is missing in the list of reference, any other

function
in any other referenced library can be "not found" by the compiler. It is
as if a single missing reference screws up the entire system of typelibs.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"StargateFanFromWork" wrote in message
...
Knew there had to be some reason why it's worked everywhere but here.
Well, I took a look in the Tools References of the VBE and the only
thing that I could see out of the list that says "missing" is

MISSING: Microsoft Calendar Contro 9.0

which seems odd. But it's missing. And this references a missing OCX
called MSCAL.OCX. Does this govern something as simple as "carriage
returns" <g?

At any rate, tried the alternative suggested of vbCr even though I never
have much luck with that one. Sure enough, only got a little box.
So hunted around for what has worked before (I don't have too many VB
message boxes so took me some time to find). I subsbituted the vbCr

with
vbCrLf and even though I still get a little box, I at least get a

carriage
return inside the cell which is what counts. Fortunately, all this
involves tips or help information that I have assigned as macros to
buttons on my Excel.xlb to give me easy access to 4 things I use over

and
over and saves me hunting them down, so the little boxes are a nuisance,
but I can live with them until I fix this problem.

Any suggestions on how to fix this, as I must admit I haven't an idea

how
to fix (unless it's the missing MSCAL.OCX that's the culprit and hunting
that down).

Thanks. :oD

"Peter T" <peter_t@discussions wrote in message
...
Very likely you have a missing reference, in Tools / References look

for
a
ref marked MISSING.

As a short term fix to get out of trouble until the ref is solved try

VBA.Strings.Chr$(10)
or
VBA.Constants.vbLf

Regards,
Peter T

"StargateFanFromWork" wrote in message
...
When I've recorded a macro with text and have done the ^+Enter, the
macro
records that as " & Chr(10) & ". The macros I have that do this have
worked for years without any problems. But here, in this new

contract,
weird stuff is happening. I now get the error:

"Compile error: Can't find project or library"

The "Ch" in the above " & Chr(10) & " is then shown highlighted in

dark
great and the title for the macro is highlighted in yellow.

What can we use in place of ^+Enter to create a hard return in a cell
via
a
macro, and so that " & Chr(10) & " isn't needed?

Thanks. :oD











All times are GMT +1. The time now is 01:36 PM.

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