Exporting to excel from Access
Here is a Procedure that will change your text numbers into actual numbers.
It also removes the apostrophe from Text. Highlight the range you want to
convert and run the macro.
Private Sub Convert()
Dim rngCurrent As Range
Dim rngToSearch As Range
Set rngToSearch = Intersect(ActiveSheet.UsedRange, Selection)
If Not rngToSearch Is Nothing Then
Application.Calculation = xlCalculationManual
For Each rngCurrent In rngToSearch
If Left(rngCurrent.Value, 1) < "=" Then
If IsNumeric(rngCurrent.Value) Then
rngCurrent.NumberFormat = "0"
rngCurrent.Value = CDbl(rngCurrent.Value)
rngCurrent.Formula = rngCurrent.Value
Else
rngCurrent.Formula = rngCurrent.Value
End If
End If
Next
Application.Calculation = xlCalculationAutomatic
End If
End Sub
HTH
"Stuart Y." wrote:
Ok, ive asked this already a bunch in other discussion places, but no one
knows. Or cant fix it. This is pretty much my last hope. Here it is. I am
trying to export a table from access into an excel page. I can do that, i got
that far. Now, my excel page is full of formulas that make a really good
summary sheet. All the data that im using in access is there, but when i put
it into the relevant cells, the calculations dont work. All of the text cells
have an apostrophe (') added to the beginning of the data. As well, all the
numerical data (which doesnt have the ' added) doesnt work either, but it
seems like normal data. Is there something i need to do? or am i pretty much
outa luck here?
|