toto = "178.18.245.17" & vbCrLf & "- Zone : Germany" & vbCrLf & "Blacklist : 3 "
Range("A1").Value = Replace(toto, Chr(13), "")
A noter que je n'utilise pas VBA du fichier excel. Je code uniquement ma petite form VB
Pour passer des lignes dans un cellule, il faut faire un Alt+Entrée à la main
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Const CF_TEXT = 1 Private Declare Function GetClipboardData Lib "user32" (ByVal wFormat As Long) As Long Private Declare Function CloseClipboard Lib "user32" () As Long Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As Long) As Long Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Long, ByVal ByteLen As Long) Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim hStrPtr As Long, lLength As Long, sBuffer As String OpenClipboard Application.hwnd hStrPtr = GetClipboardData(CF_TEXT) If hStrPtr <> 0 Then lLength = lstrlen(hStrPtr) If lLength > 0 Then sBuffer = Space$(lLength) CopyMemory ByVal sBuffer, ByVal hStrPtr, lLength Target.Value = Replace(sBuffer, Chr(13), "") End If End If CloseClipboard End Sub