|
-
Aug 29th, 2000, 08:44 AM
#1
Thread Starter
Lively Member
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
-
Aug 29th, 2000, 08:46 AM
#2
Frenzied Member
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()
-
Aug 29th, 2000, 08:53 AM
#3
Thread Starter
Lively Member
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.
-
Aug 29th, 2000, 08:59 AM
#4
Frenzied Member
what do you mean format of cells of excell?
-
Aug 29th, 2000, 09:08 AM
#5
Thread Starter
Lively Member
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
-
Aug 29th, 2000, 09:41 AM
#6
New Member
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
-
Aug 29th, 2000, 10:00 AM
#7
Thread Starter
Lively Member
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)
-
Aug 29th, 2000, 10:27 AM
#8
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|