Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Formating Date As 1st,2nd,3rd Rather Than 1,2,3


How can you format the date so that you get something like

11th Nov 11:52 rather than 11 Nov 11:52

I want to be able to add the 'th' bit - I have looked at the format function but this does not seem to support it.

I could create an array with them all in myself and use the day of the month as this index - however surely there is a built in function for this?

Any ideas?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Formating A Date
when i format my date to a long date and then want to format back to a short date "mm/dd/yyyy" it won't format it stays a long date.
i tried this


text1 = format(text1,"long date") turns it into a long date
text1 = format(text1,"mm/dd/yyyy") this does not turn it back into a short date

Formating Date
Hi guys,

I have urgent problem. I have finally prepared an excel file where in the modules I am using format function.

VB Code:
UserForm1.TextBox1.Value = Format(Now, "dd.mm.yy")


This code is running on my machine, but do not run on ther pc's. Other machines do not know the format function. What I should install there to run this function or has anybody idea how to format the date in other way?

Please help. It is very urgent.

Thanks. Boris

Formating Date
How can I change 01/15/2003 9:00:00 AM into 01/15/2003 9:00 AM ... that is without the seconds in the time? Thanks

Formating Date
I have a DbGrid bound to a table using SQL Server
as you know sql saves the date as yyyy-mm-dd. Because the grid in bound this field is displayed as yyyy-mm-dd, but i want to change this default to DD/MM/YYYY.

Formating A Date
How do I format Sunday, October 22, 2000 07:26:00-EDT so that I can get the day number by itself and the month by itself. Then I want to get 07:26:00 into a string!

Date Formating In My Textbox
hello guys!

i have some problems with regards to date input on my textbox. i want it to be on this format "MM/DD/YYYY" its hard for me to trap these errors using keypress because i have a lot of textbox that needs this format! wah! how can i validate each textbox with this kind of format. my plan is that... the textbox1.text="MM/DD/YYYY" when the user clicks the textbox... it will clear the textbox1.text="". now... my problem is that... i want the user to stay on mm/dd/yyyy format... what should i do??? i have a lot of textbox that needs this format.

Date Formating In Access2000
Hi All,

First of all, I have my machine locale set to english Uk, Date's set to dd/mm/yyyy time set to hh:mm:ss. (through control panel)

In an access database I have a table with a field declared as type date. and its default value is set to NOW(). I have also set it's format to GeneralDate.

if I perform a query on the table such that the where clause looks like:
(((EventLog.EventTime)>#04/07/2002 00:00:01# And (EventLog.EventTime)<#04/07/2002 23:59:59#))

It returns no records. If I swap the day/month around then it returns the correct records and it displays it in dd/mm sequence.

What do I need to set for Access to accept the date in dd/mm/yyyy format and not mm/dd/yyyy format.

Regards
Bill Crawley

Formating Date:newbie Woe
i was trying to do the clock tutorial

http://www.vbworld.com/internet/atomictime/
i followed it thru until i got to the bit where u set the pcs clock using this code

Public Sub SetDate(NewDate As Variant)

On Error Resume Next

DateTime.Date = NewDate

End Sub

Public Sub SetTime(NewTime As Variant)

On Error Resume Next

DateTime.Time = NewTime

End Sub

i played about with it for a bit and finally got it to set it, but the time was 1 hour greater than gmt (which is what i want)
how do i change it, cos ive been having trouble doing that
i tried to modify this bit
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Dim datDate As Date
Dim hour As String

Winsock1.GetData strData, vbString

datDate = FormatDateTime(strData)

SetTime (Format(datDate, "hh:mm:ss"))
Winsock1.Close

End Sub
which works but is one hour head
when i try

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Dim datDate As Date
Dim hour As String

Winsock1.GetData strData, vbString

datDate = FormatDateTime(strData)

hour = (Format(datDate, "hh")) - 1
SetTime "hour:"(Format(datDate, "mm:ss"))
Winsock1.Close

End Sub

and run it, the error is expected end of statment and highlights the bracket after settime "hour:"(

any help would really be appreciated

thanks

Problems Formating Date
I am using this code so that text3 will take the date from text1 and add 7 months. It worked fine untill I added the format part.
Now when I enter text1 > 01/01/2001
text3 displays> 06/22/2001

I would like it to be: text1 > 01/01/2001
text3 > 07/01/2001

Any ideas on how to fix this code?



Code:
Dim FirstDate As Date ' Declare variables.
Dim IntervalType As String
Dim Number As Integer
Dim Msg
IntervalType = "m" ' "m" specifies months as interval.
FirstDate = Text1.Text
Number = 7
Text3.Text = "New date: " & DateAdd(IntervalType, Number, FirstDate)
Text3.Text = Format(Date, "mm/dd/yyyy")

Modems And Date Formating
hi i want to do something, but i don't know if i can do it in vb with vb or any other way
i wanna know how to listen to a telephone conversation over my speakers. all i have is my modem
hooked up to the comp. is this possible?

i have another question. how can i force a user to enter a time in
a specific format? and that format only
e.g - i want the user to enter a time with the format (hh:mm:ss) how can i do it?

Formating The Date Function
I was wondering how to format the Date function from this "01/01/01" to read in a lable "January 1, 2001".

Thanks

Bob

Date Formating And Datediff In Vb 6.0
Date formating and datediff in vb 6.0 ...?

Date Formating Using VB Script
How do i Format date in VB-Script so as to insert into pervasive sql

Date Formating In ComboBox
I am trying to pre-load a combobox with mm - dd - yyyy dates starting with 7 days earlier to a week from the current date. I would also like to show the current date in the .text thanks for any help!

Problem While Formating Date
Hi All
I have changed my language settings and then I started facing problem in FORMAT API.
It is unable to interpret AM or PM. Please let me know if any other option is there similar to FORMAT which is compatible with any language and able to interpret am and pm also.Following peace of code is giving problem.
Code:Format$(Now, sDate & "DDMMYYYY_HH_mm_ss_AMPM")

Date Formating In A Macro
I have a problem with Date formatting in a macro. When I record a macro to remove spaces from something like the following "03 /02 /03" and then convert it to "03-Feb-03" I run into a problem. getting rid of the spaces is fine, setting the date format is fine, when I stop recording the macro and run it, it removes the spaces and then automatically sets the date format to "mm/dd/yyyy" thus my date of "03-Feb-03" actually appears as "02-Mar-03". Any thoughts?

Changing Date And Time Formating
Hi everbody
I am writing an applications where i need to display date and time in different formats, I wanna change the date and time format of the system itself by using my own application rather than going to control panel-regional seeting-date time.
What are the API's that i can use and how???
Please provide the assistance

Yours Loving
bil_all

Formating A Date Field In An SQL Statement, How?
All,

I have the below SQL statement which is populating a ADO data grid

Code:
rsStr = "Select QuoteDate as Quote_Date, QuoteNumber as Quote_Number, CollNumber as Collector_Number, " _
          & "PartNumber as Part_Number, QuoteStatus as Quote_Status " _
          & "From qtndet where EntityNumber = '" _
          & EntNun & "' and ContactNumber = '" & ContNum & "' " _
          & "Order by QuoteNumber, CollNumber"
    
    Set rsContGd = New ADODB.Recordset
    
    rsContGd.CursorType = adOpenStatic
    rsContGd.CursorLocation = adUseClient

    rsContGd.Open rsStr, cn1
    
    
    Q = rsContGd.Supports(adBookmark)
    
    
     If Not rsContGd.EOF Then
        X = rsContGd(1)
        cntGrid.Visible = True
        Set cntGrid.DataSource = rsContGd
        cntGrid.Refresh
    Else
        MsgBox "There are not deals/quotes for the selected Contact", vbDefaultButton1, "Can Not Load Grid"
        cntGrid.Visible = False
       
    End If
    


I have two question:

1. The query is taking appox ten seconds to run, is there something you see which would give me better effiency?

2. The data in the "Quote Date" field is in YYYYMMDD format, it came from the AS400.
     Is there a way to modify the format of the data before it populates the data grid?

Thanks in advance.

Formating Date Fields In Access
Hi. I am new @ VB. I created a small database in access XP. My problem is as follows:

I have 2 fields. I have the first field as a date field, where I manually type in a date. The second field automatically adds 365 days and displays 1 year from the year in field 1. I want field 2 to turn yellow (any colour) when it is 90 days before that date displayed. What code do I need...Please help this has been driving me nuts...hehe

sirjones

Using Edit Mask For Formating Date.
I would like to being able to have the date appear automatically
then being able to have the user change it if needed, in the same format.
? Can I use the edit mask to do this, and if I can How.

Also how would I format a input box for a SSN nunber to look like ### - ##- ####
I know I can do it with a edit mask, but how?

Any help would be appreciated.

Thanks Greg.

HTML Document To Excel Worksheet, Unwanted Date Formating On Number Values
Have a problem with numbers in a html document becoming dates when i arrives in the excel worksheet. For example you have this

id no j.Date department
05/2234 1 28.07.2005 sedo

which results in, in excel


id no j.date department
may.34 1 28.07.2005 sedo



is there a way to use the excel object to specify the formating on columns in the excel worksheet?

code snippet

Sub g_TXOpneExcel97(sFilename As String, Optional bReadOnly As Boolean)
    Dim MyApplication As Object
    Dim MyWorkbook As Object
    Dim MySheet As Object

    Dim objMP As CMousePointer: Set objMP = New CMousePointer: objMP.SetCursor vbHourglass

HentObjekt:
    On Error GoTo LagObjekt
    Set MyApplication = GetObject(, "Excel.Application")
    GoTo Fortsett

LagObjekt:
    On Error GoTo FEILBEHANDLER
    Set MyApplication = CreateObject("Excel.Application")

Fortsett:
    sFilename = g_BRVenstreSkiller(sFilename)
    MyApplication.Workbooks.Open FileName:=sFilename, ReadOnly:=bReadOnly
    

    MyApplication.Visible = True
    MyApplication.WindowState = -4137

Avslutt:
    'Screen.MousePointer = vbDefault
    Exit Sub

FEILBEHANDLER:
    gsModul = "TXTekst": gsProsedyre = "g_TXLagExcel97"
    Call g_BRFeilBehandler(Err.Number, Err.Description, True, "")
    Resume Next

End Sub

DATE Problems - Change Date Format To European, Get Current Date, Subtract 2 Dates?
Need someone to point me in the right direction/start me off with this please as I am quite clueless on it at present...

I need something that can successfully subtract two dates...


eg. calculate the difference between the current date
02/04/04 (2nd April 04) and 29/03/04 (28th March 04)
...
which will then output a result of 5 days


So what I need to know is...

1.
I need to know how to get the current date from the system clock

2.
I must somehow get my date function converted into European date format (as at present it is in USA format ie. 2nd April 04 is 04/02/04 like April 2nd 04 which is not good!)

3.
and then I must actually SUBTRACT the 2 dates (the current date and a date that is given) from each other to give an integer which I can then use (ie. a value like 5 or 15).


But I have little idea how to go about this


Can anyone please start me off?

DATE Problems - Change Date Format To European, Get Current Date, Subtract 2 Dates?
Need someone to point me in the right direction/start me off with this please as I am quite clueless on it at present...

I need something that can successfully subtract two dates...


eg. calculate the difference between the current date
     02/04/04 (2nd April 04) and 29/03/04 (28th March 04)
     ...
     which will then output a result of 5 days


So what I need to know is...

1.
I need to know how to get the current date from the system clock

2.
I must somehow get my date function converted into European date format (as at present it is in USA format ie. 2nd April 04 is 04/02/04 like April 2nd 04 which is not good!)

3.
and then I must actually SUBTRACT the 2 dates (the current date and a date that is given) from each other to give an integer which I can then use (ie. a value like 5 or 15).


But I have little idea how to go about this


Can anyone please start me off?

Every Record Has A Date Field. I Want To Find A Date And From This Date, I Want To Read Records To E
Every record has a date field. I want to find a date and from this date, I want to read records to eof. What is the code? - Thanks

Formating Is It Possible...???
Code:
Option Explicit

Private Sub Form_Load()
Open "C: est.xls" For Output As #1
Print #1, "HEADER"
Print #1, ""
Print #1, "item 1" & vbTab & "item 2" & vbTab & "item 3"
Print #1, "item 4" & vbTab & "item 5" & vbTab & "item 6"
Print #1, ""
Print #1, "item 7" & vbTab & "item 8" & vbTab & "item 9"
Print #1, "item 10" & vbTab & "item 11" & vbTab & "item 12"
Close #1
End Sub
I have this code it actually work when i open it in excel my question is. is it possible to put formating on them??? Like i would like the "HEADER" to be printed in BOLD.......

tnx.....

Formating
as i have posted on all my threads I am new to vb

this must be the dumbest question ever asked

I am trying to format a text box to display the now time and date but i am not sure where to do the formating is it in the the control button code or is it that the text box that needs to have an event i have the language refrence books from vb4 where i find examlple code but cant seem to get this working

has vb6 code features moved on and the examples are not up to date

could sombody inform me of the route to take [color=Blue]thanx as always[/COLOR]

ADO Formating
I have the following VB6 code that poplates a data grid(grddata) using ADO from a csv file.

Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset

strFile = "C:my.csv"
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & strDir & "; Extended Properties=""Text;HDR=No,FMT=DELIMITED;"""
rs.Open "Select * from " & strFile, cnn, adOpenStatic, adLockReadOnly
Set grdData.DataSource = rs

The majority of the columns are text so ADO recognises the values without any problems however the first set of values for one of my colums is pure numbers & ADO picks it up as an integer. The latter values in the same column are a combination of alpha & numeric consequently in the datagrid these are populated by ADO as blanks.

How can I set the properties for incoming ADO field to recognise the column as a string rather than an integer.

Many Thanks
Mick

Formating + &amp; - ?
In formating columns for files or listboxes , if numbers be negative ,columns will be moved .
How can I prevent this ?

col 1 col 2 col 3
------ ------- ------
00.123 00.321 00.562
-02.256 01.562 -14.258

a way is that formating negatives value as "0.000"
and positives as "00.000"
I don't want this !

Formating Now
I'm looking for help on how to obtain the numerical value of a date.

ie. In Excel if I enter a date into a cell - 11/29/2006 the cell changes to date format. Then when I overide the the cell format back to general or number i get the number 39050.

Is it possible to do this in VB6?

Formating... Help
I am doing some parseing and I Need to Format a label to automaticly put in aposrophes for numbers... For Example this is what it is showing: 5555555 and I want it to display 5,555,555 how to I do this?

DATE Problem - Formatting US Date MM/DD/YY To European Date Format DD/MM/YY
I have a problem whereby the user must enter a date into a field...

The system changes the date format to US standard which is MM/DD/YY
but I need to change the format to DD/MM/YY (European standard)


I have done this using the Format function, but I still have a slight problem
Format(mydate,"dd/mm/yy")

doesnt account for all dates...

for example...
if I enter 31/03/04 this is fine, it will accept it as that

However, if I enter 02/04/04 (todays date - 2nd April 04), it will change it to 04/02/04



Any ideas how I can counter this from happening?

Query With Date Ranges And Return Only Closest Date To 'to Date'
I am using an access db...

I am trying to pull back due dates for credit reports for clients. I have 4 tables I am working with for this query...

    [Client_info]
    [Dispute_track_eq]
    [Dispute_track_exp]
    [Dispute_track_trans]

[Client_info] has the basic client information....ID, SSN, name, telephone_numbers, yadd yadda..
    each of the other tables hold the fields I am pulling from(other fields as well but these are the ones i need)...

    [Dispute_track_eq].eq_due_date
    [Dispute_track_exp].exp_due_date
    [Dispute_track_trans].trans_due_date

Here is my problem...
    I have variable that are set by dtpickers...'from_date' and 'to_date'. I am trying to get back each of these due dates that fall between the ranges set along with the [client_info] data linked by the SSN field. The problem is that sometimes these clients will have multiple due_dates(multiple rows) between the range. What the end result needs to be is this, I need to only have one record to come back with one of each due_date from each table, but only give me back the closest due_date to the 'to_date'(set by dtpicker) as well as the data from the [Client_info] table. And if there are no records for one or two but not the thirs field, an empty fields is ok(using a datagrid). But I can only pull back one row with the [client_info] fields, and one of each of the 3 due date fields. I have a query already but it doesnt even come close to working, it gives me many duplicates and doesnt give me the closest due_date to the 'to_date'.

Here is my query, but it doesnt work. Any help would be greatly appreciated, I am in dire need of help on this one.

Code:Private Sub Command4_Click() '***Due dates report grid date
    to_date = dt2.Value
    from_date = dt1.Value
    If from_date = vbNull Then
            MsgBox "Please select a FROM DATE"
            Exit Sub
        ElseIf to_date = vbNull Then
            MsgBox "Please select a TO DATE"
            Exit Sub
    Else
    Dim ID_new As String
    Dim cn As ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim strSQL As String
    Dim ID_pass As String
    Dim active As String
    
    active = "Active-Negotiations"
   
    Set rs = New ADODB.Recordset
    
    
        strSQL = "Select" & vbNewLine
        strSQL = strSQL & " [client_info].[FirstName], [client_info].[LastName], [client_info].[HomePhone], [client_info].[MobilePhone], [client_info].[Client_status], [client_info].[Category], [client_info].[Appt_notes],[client_info].[Appt_date],[client_info].[Appt_date_time], " & vbNewLine
        strSQL = strSQL & " [dispute_track_eq].[eq_due_date], [dispute_track_exp].[exp_due_date], [dispute_track_trans].[trans_due_date]" & vbNewLine
        strSQL = strSQL & " FROM (dispute_track_exp INNER JOIN (dispute_track_eq INNER JOIN client_info ON [dispute_track_eq].[SSN] =[client_info].[SSN]) ON [dispute_track_exp].[SSN] =[client_info].[SSN]) INNER JOIN" & vbNewLine
        strSQL = strSQL & " dispute_track_trans ON [client_info].[SSN] =[dispute_track_trans].[SSN]" & vbNewLine
        strSQL = strSQL & " Where (dispute_track_trans.trans_due_date > #" & from_date & "# And" & vbNewLine
        strSQL = strSQL & " dispute_track_trans.trans_due_date < #" & to_date & "#)" & vbNewLine
        strSQL = strSQL & " OR (dispute_track_eq.eq_due_date > #" & from_date & "# And" & vbNewLine
        strSQL = strSQL & " dispute_track_eq.eq_due_date < #" & to_date & "#)" & vbNewLine
        strSQL = strSQL & " OR (dispute_track_exp.exp_due_date > #" & from_date & "# And" & vbNewLine
        strSQL = strSQL & " dispute_track_exp.exp_due_date < #" & to_date & "#) AND NOT NULL"


    Set cn = New ADODB.Connection
    With cn
           .Provider = "Microsoft.Jet.OLEDB.4.0"
           .ConnectionString = "Data Source= " & db & " "
           .open
    End With
    
    Set rs = New ADODB.Recordset
    With rs
        .ActiveConnection = cn
        .CursorLocation = adUseClient
        .CursorType = adOpenStatic
        .Source = strSQL
        .open
    End With
        
        If rs.RecordCount = 0 Then
            MsgBox "Sorry, no one matched that status, try again", vbOKOnly, "Credit Matrix"
            Set DataGrid1.DataSource = rs
        Else
            Set DataGrid1.DataSource = rs
    
        End If
        End If

    I would be forever in your debt for helping me as I am almost out of hair....FROM PULLING IT OUT!!
    



Edited by - ronmegga on 4/1/2004 5:26:03 PM

DATE Problem - Formatting US Date MM/DD/YY To European Date Format DD/MM/YY
I have a problem whereby the user must enter a date into a field...

The system changes the date format to US standard which is MM/DD/YY
but I need to change the format to DD/MM/YY (European standard)


I have done this using the Format function, but I still have a slight problem
Format(mydate,"dd/mm/yy")

doesnt account for all dates...

for example...
if I enter 31/03/04 this is fine, it will accept it as that

However, if I enter 02/04/04 (todays date - 2nd April 04), it will change it to 04/02/04



Any ideas how I can counter this from happening?

Deleting / Formating
hi all.

i need to remove all files from a floppy disc. i dont mind if it is by deleting or formating, andone have any ideas?



Thanks

Bianry Formating
I need to get a VB6 script that can replicate these PHP Functions:

unpack("aast/Ctype/nseq/ndlen", $header);

and

pack("aCnn", "*", $sflap_type, $connection['sequence_number'], strlen($sflap_data));


Any help or ways to figure this out are greatly appreciated.

e-mail: petersonr@pa.net

Formating Quesion
I have an access table with bunch of number in the format 00001,00002 and so on.

When I read it using VB, they are read as 1, 2 thus ignoring the zeros. I have tried to assign it to both a long or a string variable to no avail. I am using the following code to read it.

dim numb as string

Set db=Opendatabase("path")
set rs=db.openRecordSet("SELECT * FROM Q1 WHERE STATUS =" & "YES")

With rs
.moveFirst
.Edit
Numb=!partNumber
end with

Please Help - Formating Columns
Hi All

I want to search thru an excel worksheet and find all all columns that conatin numbers and format those numbers e.g. 0.00 and 0%.

I also want to be able to insert columns into the worksheet at a particular point. i want to do all this from VB6.

All your help would be appreciated.

Text Formating
Any ideas which method is used to format text in a new email within outlook.

With ActiveInspector.CurrentItem

.Body = .Body + "===========" + LineFeed
.Body = .Body + "BLA BLA BLA" + LineFeed
End With

This adds Bla bla to the bottom of my new mail, but changes the format of the text already entered in to Arial 10pt, not very interesting, and I can't find a way of getting this blabla to be in a different font / size / color.

Thanks very much for any help,
HandyMac

? About Formating Excel
hello all

i have kind of a stupid question but i am exporting a set of 12 labels for vb to excel and have run into a problem. i want to blod outline all the labels with are 1 column by 5 rows. i know how to outline them one label at a time but i cannot figure out how to set up a function or sub that can save some code. here is the code i am using right now and it will only outline the first label.
Code:
Dim cnn1 As New ADODB.Connection, strSQL As String, Row As Long, Col As Long, A As Integer
Dim rstAccess As New ADODB.Recordset, Loaner As Integer, strMFG As String, strESN As String
Dim SubLock As Integer, BarCode As String, X As Integer, Y As Integer, strModel As String
Dim oExcel As excel.Application, oWB As excel.Workbook, oWS As excel.Worksheet, oRng1 As excel.Range
Dim oRange As excel.Range
Const strLoaner = "Loaner Phone #"
Const strLock = "SubLock: "

Private Sub Command1_Click()
strMFG = "Nokia"
strModel = "1234"
strESN = "* 12345678912 *"
Row = 0
Col = 2
Set oExcel = New excel.Application
oExcel.Visible = True ' <-- *** Optional ***
Set oWB = oExcel.Workbooks.Add
Set oWS = oWB.Worksheets("Sheet1")
Call fill
End Sub

Private Sub fill()
oWS.Columns("A:A").ColumnWidth = 2.29
oWS.Columns("C:C").ColumnWidth = 2.29
oWS.Columns("E:E").ColumnWidth = 2.29

For Y = 1 To 4
Row = Row + 3
For X = 1 To 3
oWS.Cells(Row, Col).Value = strLoaner & " " & X
oWS.Cells(Row, Col).Font.Size = 14
oWS.Cells(Row, Col).Font.Bold = True
Col = Col + 2
Next X
Col = 2
Row = Row + 1
For A = 1 To 3
oWS.Cells(Row, Col).Font.Size = 18
oWS.Cells(Row, Col).Value = strMFG & " " & strModel
oWS.Cells(Row, Col).Font.Bold = True
Col = Col + 2
Next A
Col = 2
Row = Row + 1
For A = 1 To 3
oWS.Cells(Row, Col).Value = "ESN: " & strESN
oWS.Cells(Row, Col).Font.Size = 12
oWS.Cells(Row, Col).Font.Bold = True
Col = Col + 2
Next A
Col = 2
Row = Row + 1
X = 0
For X = 1 To 3
oWS.Cells(Row, Col).Font.Size = 14
oWS.Cells(Row, Col).Font.Bold = True
oWS.Cells(Row, Col).Value = strLock & "123456"
Col = Col + 2
Next X
Col = 2
Row = Row + 1
For A = 1 To 3
oWS.Cells(Row, Col).Font.Size = 40
oWS.Cells(Row, Col).Font.Name = "Barcode Font"
oWS.Cells(Row, Col).Value = strESN
With oWS.Cells(Row, Col)
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = 0
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Col = Col + 2
Next A
Col = 2
Next Y
oWS.Columns("B:B").EntireColumn.AutoFit
oWS.Columns("D:D").EntireColumn.AutoFit
oWS.Columns("F:F").EntireColumn.AutoFit
Call Outline
End Sub

Private Sub Outline()
oWS.Range("B3:B7").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone

End Sub
any help would be greatly appreciated

Formating Cells
If I am passing a string into excel like this

report.cells(1,2) = "text"

what can I do to make "text" bold and underlined

thanks for the help

Formating Cells
I would like to format the information I pass from my vb6 application to excel. Specifically I would like to bold and underline the data.

Thanks for the help

Help-If Conditional Formating
I am trying to write some code that will check if Column Y="N" and if it does it will check Column R, O, G and if there is no color index in any of the Columns the macro will delete the row.

Column Y-has Y, N entered in cells
Column R-has 1,2, etc... entered in cells ( some cells have color index 26 ) Color set by Conditional Format
Column O-has 1, 2, etc... entered in cells ( some cells have color index 3 ) Color Set By Format
Column G-has names entered entered in cells ( some cells have color index 38 ) Color set by Conditional Format

There are 3000 rows on the spreadsheet and the macro would need to loop through all the rows. Any help would be appreciated.

Formating String...
has anybody made a formatstring function so it can fit on the form or usercontrol not only words with space but bigger words than the form/usercontrol being splitted to the next line i have tried to make one but it has messy code and doesn't work right on dots or on other small characters can't really figure out what i did wrong

Formating A Number
hey guys,

how could i format a number so that 1 million (1000000) would come out as 1,000,000 ?

is it possible? i just want to display it like that as its alot neater and more professional.

Thanx in advance

Formating Text
is there a way to display text in a textbox without erasing the current text from it.

what I'm trying to do is display a random number, then run the random sub I have then display the next number under it ...then the next number and so on
untill I have 10 numbers listed.........Herman

Formating A String
Hi all, need hel;p with remove dashes from a string..
If i have a string which looks like:
0-00-0-00-00-00

How can i get it to remove the '-' so that it looks like:
0000000000

The string maybe different lengths, so would only need to look for the dash.

Help much appricated.
Dave

RichTextBox Formating
hey, i have a function that gets me heaps of specs and things regarding my program. now at current what im doing is displaying that string in the richtextbox and then using a loop function that goes and scans the string for certain keywords and then changes the font of them. now the problem is that there are sometimes close to 1000 lines and my loop function takes too long and it all just looks messy. is there a better way of doing this??

is it posible to change the font of those certain words before it goes into the rtb? would this be faster??

thanks heaps.

Number Formating
Hi guys, this is my first post so hello everybody!

Just need alittle help with formating the data entry into a text box.

I want to enter numbers into a txt box, but they need to be such a format that they are all the same length no matter what the value.

ie. 00000 to 99999 and values in between ie 00150 and 09650 etc.

how do i go about doing that, in a simple way??

Time FORMATING
Morning Guys

It is still morning hear in South Africa,guys I have two DTPickers that I use to for my Start time and End time,So I have been trying to check if the system can be able to notice which one is smaller than another one,to my suprise when I put 10:00 AM in Start Time and 12:00 PM in End time,it tells me that they are equal!
May someone help me how can I solve this greater and less than problem of this DTPickers or help with other option,Please. I will be waiting for your responses.

Thanx in advance.

Copyright 2005-08 www.BigResource.com, All rights reserved