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
Printable View
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
to insert soemthing into a combo box
use .ADDITEM of the control
to use different formating functions
look up FORMAT()
OK, I know how to insert into a combo items, but my questions is how can i extract the format of cells of Excell.
what do you mean format of cells of excell?
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
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?
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)
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