S
sifar
hi,
I am trying to copy the contents of a clipboard which was copied from
an html file which has 2 verticals columns viz, 1st column for labels
& 2nd column for Values.
e.g.
first Name | abc
Last Name | fgh
Tel | 12345678
error | flashing adsl
etc.....
I am copying the 2nd column (values) to clipboard by selecting the
cells from top to bottom on html page.
when i goto excel sheet (which has similar 1st column labels in the
first row), i want to place these values under the respective labels
horizontally (transpose).
The below code in Sheet1 does not seem to work.
Please Help!
Warm Rgds,
Sifar
============================================
Option Explicit
Dim MyDataObj As DataObject
Dim LastRow As Long
Public Function GetOffClipboard() As Variant
Dim MyDataObj As New DataObject
MyDataObj.GetFromClipboard
GetOffClipboard = MyDataObj.GetText()
End Function
Sub PasteTxT()
With Worksheets(1)
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
LastRow = LastRow + 1
.UsedRange.Cells(LastRow, "A").Activate
.Range(ActiveCell, ActiveCell).PasteSpecial_ Paste:=xlPasteValues,
Transpose:=True = GetOffClipboard()
End With
End Sub
================================================
I am trying to copy the contents of a clipboard which was copied from
an html file which has 2 verticals columns viz, 1st column for labels
& 2nd column for Values.
e.g.
first Name | abc
Last Name | fgh
Tel | 12345678
error | flashing adsl
etc.....
I am copying the 2nd column (values) to clipboard by selecting the
cells from top to bottom on html page.
when i goto excel sheet (which has similar 1st column labels in the
first row), i want to place these values under the respective labels
horizontally (transpose).
The below code in Sheet1 does not seem to work.
Please Help!
Warm Rgds,
Sifar
============================================
Option Explicit
Dim MyDataObj As DataObject
Dim LastRow As Long
Public Function GetOffClipboard() As Variant
Dim MyDataObj As New DataObject
MyDataObj.GetFromClipboard
GetOffClipboard = MyDataObj.GetText()
End Function
Sub PasteTxT()
With Worksheets(1)
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
LastRow = LastRow + 1
.UsedRange.Cells(LastRow, "A").Activate
.Range(ActiveCell, ActiveCell).PasteSpecial_ Paste:=xlPasteValues,
Transpose:=True = GetOffClipboard()
End With
End Sub
================================================