Results 1 to 8 of 8

Thread: Simple Question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    México, D.F.
    Posts
    64

    Cool

    Hy!, just 1 Question, How can I insert into a combo the formats of numbers and times of the cells of Excell.


    Soory about my English.


    Thanx

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539

    Talking dont undrestand.. here is what i think

    to insert soemthing into a combo box
    use .ADDITEM of the control
    to use different formating functions
    look up FORMAT()

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    México, D.F.
    Posts
    64

    Re: dont undrestand.. here is what i think

    OK, I know how to insert into a combo items, but my questions is how can i extract the format of cells of Excell.

  4. #4

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    México, D.F.
    Posts
    64

    Cool

    ok, for example: Locate into one cell in Excell, then push Ctrl+1, then the Format Cells appears, that's what i mean.


    I want those formats to insert into a Standard Form.



    Thanx

  6. #6
    New Member
    Join Date
    Aug 2000
    Posts
    11
    You can grab the format of the cells by using

    Worksheets("The Worksheet").Range("The cell").NumberFormat

    That will tell you what formatting is applied to that cell.
    If you need to know more about what formats are applied to the cell then look up "Range" in the object browser and it will give you the rest.

    This answer your question?

    Give me five lines written by the most honourable of men, and I shall find in them an excuse to hang him. - Cardinal Richelieu

    Ben Stappleton
    VB6E SP4

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    México, D.F.
    Posts
    64
    I´m making a form in vb6 that gives diferent formats to a text box. I don´t want the formats of an especific Worksheet, what i mean is that i have to give those text boxes the formats that appears in Excell. (As same as Excell)

  8. #8
    Addicted Member Dim A's Avatar
    Join Date
    Jul 2000
    Posts
    201

    Cool Rich text boxes?

    You could probably create some rich text boxes to do what you need. If you need reusable code, I'd say create an activeX Control with enums to define the various styles you want the text box to perform. You can do a lot of what you want with mid, left, right, trim, ltrim, rtrim, and some creative string manipulations...

    If you are just trying to mimic excel, you can have a single text box to type data in, and format the data before placing it in it's new location...

    Otherwise, you'd have to use the Change event of the textbox, and use SelStart property to maintain position.

    There are API routines listed in the Tips section of vbworld that will allow you to make a textbox so that it only accepts numbers, but if you need anything other then positive integers it is a pain to use, and beeps whenever you hit a key...(I'm sure it can be modified, I just don't know the proper hex masking to use to allow the characters I'd normally like... i.e. '-', '.')

    Are you just trying to take data in, for later output to an excel spreadsheet? Other people on here would have a much better Idea about that then me.

    Hopefully this helps, I might be able to work up some code if you have any problems with the english.

    Let us know how it goes...
    Dim A

Posting Permissions

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



Click Here to Expand Forum to Full Width