· 

How to convert a text field into a date field with VBA

When you get a date from BEx Analyzer or Analysis Office the Excel internal format is Text and not Date. This means that the sorting doesn't work correctly. Use the following VBA source code to convert easily text to date.

 

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
Sub Text_to_Date()

Dim dDate As Date
Dim dRange As Range

Set dRange = Range(Selection.Address)

For Each Cell In dRange
  If IsDate(Cell.Value) Then
    dDate = Cell.Value
    Cell.Value = dDate
  End If
Next

End Sub

author.


I am Tobias, I write this blog since 2014, you can find me on twitter and youtube. If you want you can leave me a paypal coffee donation. You can also contact me directly if you want.

SAP Analysis for Office - The Comprehensive Guide
The book SAP Analysis for Office - The Comprehensive Guide by Tobias Meyer is a pdf book about SAP Analysis for Office. It is based on Analysis for Office 2.8 and contains 346 Pages.
45,00 €
SAP Analysis for Office - The Comprehensive Guide
SAP Analysis for Office - The Comprehensive Guide is a pdf book about SAP BusinessObjects Analysis for Office. It is based on Analysis for Office 2.7 and contains 299 Pages.
37,00 €

Write a comment

Comments: 0