PC Review


Reply
Thread Tools Rate Thread

Another to get hard returns in instead of: " & Chr(10) & "

 
 
StargateFanFromWork
Guest
Posts: n/a
 
      26th Nov 2007
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. D


 
Reply With Quote
 
 
 
 
Frederik
Guest
Posts: n/a
 
      26th Nov 2007
Use vbCr instead of Chr(10) to create a hard return.

"StargateFanFromWork" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> 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. D
>



 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      26th Nov 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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. D
>
>



 
Reply With Quote
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      26th Nov 2007
> Use vbCr instead of Chr(10) to create a hard return.

I think you meant to type vbLf , not vbCr.

Rick
 
Reply With Quote
 
StargateFanFromWork
Guest
Posts: n/a
 
      26th Nov 2007
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. D

"Peter T" <peter_t@discussions> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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. D
>>
>>

>
>



 
Reply With Quote
 
StargateFanFromWork
Guest
Posts: n/a
 
      26th Nov 2007
"Rick Rothstein (MVP - VB)" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
>> 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!! D


 
Reply With Quote
 
Chip Pearson
Guest
Posts: n/a
 
      26th Nov 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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. D
>
> "Peter T" <peter_t@discussions> wrote in message
> news:(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> 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. D
>>>
>>>

>>
>>

>
>


 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      26th Nov 2007
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" <(E-Mail Removed)> wrote in message
news:B212C1E0-C21B-4F08-8ADC-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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. D
> >
> > "Peter T" <peter_t@discussions> wrote in message
> > news:(E-Mail Removed)...
> >> 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" <(E-Mail Removed)> wrote in message
> >> news:(E-Mail Removed)...
> >>> 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. D
> >>>
> >>>
> >>
> >>

> >
> >

>



 
Reply With Quote
 
StargateFan
Guest
Posts: n/a
 
      27th Nov 2007
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. D

>Regard,
>Peter T
>
>
>"Chip Pearson" <(E-Mail Removed)> wrote in message
>news:B212C1E0-C21B-4F08-8ADC-(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > 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. D
>> >
>> > "Peter T" <peter_t@discussions> wrote in message
>> > news:(E-Mail Removed)...
>> >> 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" <(E-Mail Removed)> wrote in message
>> >> news:(E-Mail Removed)...
>> >>> 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. D
>> >>>
>> >>>
>> >>
>> >>
>> >
>> >

>>

>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove "hard returns" used instead of double spacing. =?Utf-8?B?TGlzZWxsZQ==?= Microsoft Word Document Management 1 13th Nov 2006 08:31 PM
"=NETWORKDAYS" formula returns a "#NAME?" error message - SOLUTION =?Utf-8?B?LUsuVC4=?= Microsoft Excel Crashes 1 18th Oct 2005 01:45 AM
Workgroup Security; Log in as "jsmith" and CurrentUser() returns "Admin"??? David Altemir Microsoft Access Security 7 16th Jun 2004 07:38 AM
dr("field").toString returns "400.0000" instead of "400" Dan C Douglas Microsoft ASP .NET 5 22nd Jul 2003 06:48 PM
dr("field").toString returns "400.0000" instead of "400" Dan C Douglas Microsoft ADO .NET 5 22nd Jul 2003 06:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:18 AM.