Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Import Hours as Text


Hello,

I have this procedure that allows me to import another tab values €‹€‹in
hours.
But I would like this data to be imported in text format.

---------------------------------------------------------------
Sub ImportCompensation()

Dim Nom As String, i As Long, j As Long
Sheets("Datas").Select
i = 3
With Sheets("Compensation")
Do While Cells(i, 1) < ""
Nom = Cells(i, 1)
For j = 1 To .Range("A65536").End(xlUp).Row
If Nom = .Cells(j, 3) Then
Cells(i, 14) = .Cells(j, 5)
Cells(i, 15) = .Cells(j, 6)
Cells(i, 16) = .Cells(j, 7)
Exit For
End If
Next
i = i + 1
Loop
End With

End Sub
------------------------------------------------------



I found this procedure to transform one hour in text format.
------------------------------------------------------
ActiveCell.Formula = "=TEXT(A1,""hh"""" h """"mm"")"
------------------------------------------------------
But the formula remains in the cell and I'd rather get my cell value.
I would like to get for example 10 hours 10 minutes in text format (not
time format)



It's possible to import formatted text with my first procedure?


Thanks for your answer.

Yves



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Import Hours as Text

If brought next idea :
Hello,

I have this procedure that allows me to import another tab values €‹€‹in hours.
But I would like this data to be imported in text format.

---------------------------------------------------------------
Sub ImportCompensation()

Dim Nom As String, i As Long, j As Long
Sheets("Datas").Select
i = 3
With Sheets("Compensation")
Do While Cells(i, 1) < ""
Nom = Cells(i, 1)
For j = 1 To .Range("A65536").End(xlUp).Row
If Nom = .Cells(j, 3) Then
Cells(i, 14) = .Cells(j, 5)
Cells(i, 15) = .Cells(j, 6)
Cells(i, 16) = .Cells(j, 7)
Exit For
End If
Next
i = i + 1
Loop
End With

End Sub
------------------------------------------------------



I found this procedure to transform one hour in text format.
------------------------------------------------------
ActiveCell.Formula = "=TEXT(A1,""hh"""" h """"mm"")"
------------------------------------------------------
But the formula remains in the cell and I'd rather get my cell value.
I would like to get for example 10 hours 10 minutes in text format (not time
format)



It's possible to import formatted text with my first procedure?


Thanks for your answer.

Yves


Look in online help for the Format() function and how you might
implement it here. Also, you'll want to change the target cell's number
format to text. (NumberFormat = "@")

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 text import as text not date dar Excel Discussion (Misc queries) 3 September 2nd 09 07:25 PM
How to Start Excel in Text Import Wizard for data import rlelvis Setting up and Configuration of Excel 0 July 10th 08 08:40 PM
How to Import Visio Text Boxes into Excel as Text Nick_adminator Excel Discussion (Misc queries) 2 December 12th 07 05:56 AM
Import text file : why do fractions in text format result in month/day? [email protected] Excel Programming 0 October 18th 07 07:41 PM
Excel Text Import creates garbage text btrotter Excel Discussion (Misc queries) 2 July 31st 07 02:36 PM


All times are GMT +1. The time now is 06:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"