Hello all!
I currently have a userform that places a large amount of data into a cell. I have tried using the code below to copy that text so the end user can paste it into our documentation program.
Sub writeData()
Dim lastRow As Integer
With Sheets("Formatted Answers")
lastRow = .Cells(.Rows.count, "A").End(xlUp).Row + 1
'insert date cell
.Range("A" & lastRow).Value = Format(Now, "MM/DD/YY hh:mm:ss AM/PM")
'insert type:
.Range("B" & lastRow).Value = .Range("B3") & "-" & .Range("B4")
'Insert date
.Range("C" & lastRow).Value = formattedAnswers
'Sort by dates:
.Range("A6:C" & lastRow).Sort Key1:=.Range("A6:A" & lastRow), order1:=xlDescending, Header:=xlNo
.Range("A6:C" & lastRow).Rows.AutoFit
End With
Range("C6").Select
Selection.Copy
End Sub
However, because the code selects the entire cell, it applies quotation marks around the entire body once it is pasted into our program. This is causing errors in our reporting, and they need to be removed. If the user double clicks inside the cell, and manually selects the text, it doesn't apply the quotes.
Is there a way to have the macro automatically do this? All I really need is to copy the text in cell C6, since that's where the new data is placed each time.
Thanks for the help, as always!
Bookmarks