Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 text import as text not date | Excel Discussion (Misc queries) | |||
How to Start Excel in Text Import Wizard for data import | Setting up and Configuration of Excel | |||
How to Import Visio Text Boxes into Excel as Text | Excel Discussion (Misc queries) | |||
Import text file : why do fractions in text format result in month/day? | Excel Programming | |||
Excel Text Import creates garbage text | Excel Discussion (Misc queries) |