I am not facing an error with this code on my computer but when i try yo work on another one with same hardware and excel version (2010 proffesional), it gives this error "runtime error 1004 worksheet class pastespecial failed". I am new and i will use this code my mini-project, thank you for your understanding
In this macro i am trying to get this data (long string) from clipboard and paste to column A commencing with a1 cell, everyline is copied to rows. Then with formulas, it is finding key words and taking values to desired cells with column and row numbers. Every line of data is pasted to rows perfectly on my computer. Data is copied to clipboard from internet page. There is no merged cells on sheet and there is no format.
Code:
[COLOR=#000000][FONT=Consolas]
Sheets[/FONT][/COLOR][COLOR=#000000][FONT=Consolas]([/FONT][/COLOR][COLOR=#800000][FONT=Consolas]"STForm"[/FONT][/COLOR][COLOR=#000000][FONT=Consolas]).[/FONT][/COLOR][COLOR=#000000][FONT=Consolas]PasteSpecial Format[/FONT][/COLOR][COLOR=#000000][FONT=Consolas]:=[/FONT][/COLOR][COLOR=#800000][FONT=Consolas]"Unicode Text"[/FONT][/COLOR][COLOR=#000000][FONT=Consolas],[/FONT][/COLOR][COLOR=#000000][FONT=Consolas] Link[/FONT][/COLOR][COLOR=#000000][FONT=Consolas]:=[/FONT][/COLOR][COLOR=#800000][FONT=Consolas]False[/FONT][/COLOR][COLOR=#000000][FONT=Consolas],[/FONT][/COLOR][COLOR=#000000][FONT=Consolas] _[/FONT][/COLOR]
[COLOR=#000000][FONT=Consolas]DisplayAsIcon[/FONT][/COLOR][COLOR=#000000][FONT=Consolas]:=[/FONT][/COLOR][COLOR=#800000][FONT=Consolas]False[/FONT][/COLOR][COLOR=#000000][FONT=Consolas],[/FONT][/COLOR][COLOR=#000000][FONT=Consolas] NoHTMLFormatting[/FONT][/COLOR][COLOR=#000000][FONT=Consolas]:=[/FONT][/COLOR][COLOR=#800000][FONT=Consolas]True
[/FONT][/COLOR]
In this macro i am trying to get this data (long string) from clipboard and paste to column A commencing with a1 cell, everyline is copied to rows. Then with formulas, it is finding key words and taking values to desired cells with column and row numbers. Every line of data is pasted to rows perfectly on my computer. Data is copied to clipboard from internet page. There is no merged cells on sheet and there is no format.
Code:
Private Sub Yapistir_Click()Sheets("STForm").Range("A1").Activate
Dim Tn As String
Dim Tna As String
Dim Tnb As String
Dim Tnc As String
Dim Tnd As String
Dim Tne As String
Tn = Range("O9").Value
Range("I61").Value = Range(Tn).Value
Tna = Range("O12").Value
Range("E6").Value = Range(Tna).Value
Tnb = Range("O14").Value
Range("E12").Value = Range(Tnb).Value
Tnc = Range("O16").Value
Range("E13").Value = Range(Tnc).Value
Tnd = Range("O18").Value
Range("E11").Value = Range(Tnd).Value
Tne = Range("O20").Value
Range("E21").Value = Range(Tne).Value
Tnf = Range("O22").Value
Range("E24").Value = Range(Tnf).Value
If Application.CutCopyMode = xlCut Then
MsgBox "dont cut"
Else
Sheets("STForm").PasteSpecial Format:="Unicode Text", Link:=False, _
DisplayAsIcon:=False, NoHTMLFormatting:=True
Abone.Text = Sheets("STForm").Range("I12")
Soyad.Text = Sheets("STForm").Range("I13")
isletme.Text = Sheets("STForm").Range("K6")
Aboneno.Text = Sheets("STForm").Range("I6")
TCNo.Text = Sheets("STForm").Range("I11")
Telefon.Text = Sheets("STForm").Range("I24")
Adres.Text = Sheets("STForm").Range("I21")
Sayacno.Text = Sheets("STForm").Range("I60")
sayacmarka.Text = Sheets("STForm").Range("J60")
End If
End Sub
Last edited: