MyTetra Share
Делитесь знаниями!
Форматы столбцов
Время создания: 18.07.2019 12:23
Текстовые метки: strformat, formatcln, vba_excel
Раздел: !Закладки - VBA - Excel - Cells
Запись: xintrea/mytetra_db_adgaver_new/master/base/1563441794f1vbhuxfyh/text.html на raw.githubusercontent.com

Sub FormatCln()

Dim strFormat As String

Dim Lng_RowEnd As Long, Lng_Cln As Long


With ThisWorkbook.Sheets("ETCT-EPN2")

Lng_RowEnd = .Cells(1048576, 1).End(xlUp).Row

For Lng_Cln = 1 To 20

strFormat = ""

Select Case Lng_Cln

Case 5: strFormat = "m/d/yyyy"

Case 6: strFormat = "m/d/yyyy"

Case 9: strFormat = "dd/mm/yy h:mm:ss"

Case 10: strFormat = "dd/mm/yy h:mm:ss"

Case 11: strFormat = "_-* #,##0.0 _?_-;-* #,##0.0 _?_-;_-* ""-""? _?_-;_-@_-" '"0.0" ' '"Comma"'

End Select

If Len(strFormat) > 0 Then Range(.Cells(2, Lng_Cln), .Cells(Lng_RowEnd, Lng_Cln)).NumberFormat = strFormat

Next Lng_Cln

End With

End Sub

Так же в этом разделе:
 
MyTetra Share v.0.59
Яндекс индекс цитирования