+ Reply to Thread
Results 1 to 3 of 3

2 small problems

  1. #1
    Michael
    Guest

    2 small problems

    Hi.

    I have a txtbox (with multiline) on a userform where the user can write
    comments to a cell (excel sheet).

    My problem is this: If the user wants to change line in the txtbox by using
    enter a square emerge at the end of the line in the sheet. Is it possible to
    remove that square?

    Is there a vb code that makes it possible to draw in a txtbox (lines,
    circles etc.) and return the drawing into a cell?
    --
    Nil Satis Nisi Optimum

  2. #2
    Gareth
    Guest

    Re: 2 small problems

    Hi Michael,

    Here's a copy of an answer I made to someone else with the same problem:

    <<I suspect this is because the new lines in the textbox are created
    with a carriage return and line feed (CHR(13) & CHR(10)) whereas the
    Excel cells just use a line feed (CHR(10)). (Although I can't recreate
    the problem you experience manually.)

    You can clean out the CHR13s by using Replace e.g.
    cells("A1") = replace(cells("A1"),vbcr,"")

    Replace is only available in Excel 2000 and greater. (You can use athe
    worksheet function replace if you're running XL97).

    Note however you don't need to do this if you don't copy text and use
    code such as:
    Cells(1, 1) = TextBox3.Text
    to place the text directly in a cell. >>

    With respect to drawing in a text box.... I have never heard of such a
    control. Off the top of my head, a very poor workaround: You could shell
    out to pbrush.exe (maybe dictate the filename?). Pop up a msgbox saying
    "click me when you've finished and saved your drawing" and then load the
    image up in your userform when they click ok.

    I also notice something called Microsoft InkPicture control on my
    toolbox that might do exactly what you're looking for. I've never used
    it though.

    HTH,
    Gareth


    Michael wrote:
    > Hi.
    >
    > I have a txtbox (with multiline) on a userform where the user can write
    > comments to a cell (excel sheet).
    >
    > My problem is this: If the user wants to change line in the txtbox by using
    > enter a square emerge at the end of the line in the sheet. Is it possible to
    > remove that square?
    >
    > Is there a vb code that makes it possible to draw in a txtbox (lines,
    > circles etc.) and return the drawing into a cell?


  3. #3
    Michael
    Guest

    Re: 2 small problems

    Thank's Gareth
    --
    Nil Satis Nisi Optimum


    "Gareth" wrote:

    > Hi Michael,
    >
    > Here's a copy of an answer I made to someone else with the same problem:
    >
    > <<I suspect this is because the new lines in the textbox are created
    > with a carriage return and line feed (CHR(13) & CHR(10)) whereas the
    > Excel cells just use a line feed (CHR(10)). (Although I can't recreate
    > the problem you experience manually.)
    >
    > You can clean out the CHR13s by using Replace e.g.
    > cells("A1") = replace(cells("A1"),vbcr,"")
    >
    > Replace is only available in Excel 2000 and greater. (You can use athe
    > worksheet function replace if you're running XL97).
    >
    > Note however you don't need to do this if you don't copy text and use
    > code such as:
    > Cells(1, 1) = TextBox3.Text
    > to place the text directly in a cell. >>
    >
    > With respect to drawing in a text box.... I have never heard of such a
    > control. Off the top of my head, a very poor workaround: You could shell
    > out to pbrush.exe (maybe dictate the filename?). Pop up a msgbox saying
    > "click me when you've finished and saved your drawing" and then load the
    > image up in your userform when they click ok.
    >
    > I also notice something called Microsoft InkPicture control on my
    > toolbox that might do exactly what you're looking for. I've never used
    > it though.
    >
    > HTH,
    > Gareth
    >
    >
    > Michael wrote:
    > > Hi.
    > >
    > > I have a txtbox (with multiline) on a userform where the user can write
    > > comments to a cell (excel sheet).
    > >
    > > My problem is this: If the user wants to change line in the txtbox by using
    > > enter a square emerge at the end of the line in the sheet. Is it possible to
    > > remove that square?
    > >
    > > Is there a vb code that makes it possible to draw in a txtbox (lines,
    > > circles etc.) and return the drawing into a cell?

    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1