PDA

View Full Version : Solved: lost vblf's



mikeo1313
06-06-2010, 01:58 PM
I had an excel vba macro replace certain strings with vblf's

Now after I brought the data into access, their all gone.

If I goto the excel source and copy and paste a SINGLE cell, the linefeed stays,, but when I import the data or copy & paste more then one cell it doesn't transfer over.

This is tragic, anyone know what can be done?

Aussiebear
06-07-2010, 02:17 AM
Post workbook please, or failing that post the code that you used to replace the vblf's, otherwise we are simply guessing.

mikeo1313
06-07-2010, 10:28 AM
Great idea.


Option Explicit
Const Xspaces As String = " "

Sub Xspaces4linefeed()
'
' Xspaces4linefeed Macro
'
' Keyboard Shortcut: Ctrl+l
'
Dim rdata As Range, rcell As Range
If Not TypeOf Selection Is Range Then Exit Sub
Set rdata = Nothing
On Error Resume Next
Set rdata = Intersect(Selection, Selection.Parent.UsedRange)
On Error GoTo 0
If rdata Is Nothing Then Exit Sub
Application.ScreenUpdating = False
With rdata
.Replace What:=Xspaces, Replacement:=vbLf
.WrapText = True
End With
Application.ScreenUpdating = True
End Sub

The 2 columns are before & after applying this vba to selection.

mikeo1313
06-08-2010, 01:30 PM
just discovered access doesnt render the vblf's on screen, in form or table,, but when you output from a recordset their still there. So its safe to assume there really isn't a problem. thanks anyway