Pasting in code and clipboard message

K

KarenH

I have a spreadsheet with procedure that goes through all the files in a
particular path, copies a specific column out of each and pastes it in the
new one. After copying and pasting, I close the source file, and get the
message saying there is a large amount of data on the clipboard, do I want to
save it. Once it is pasted, I don't need to save it on the clipboard.

Is there a way of keeping this message from appearing with every copy &
paste? The code is below, the line marked with the arrows is the one that
triggers the clipboard message. Thanks.

For Each flName In fls
If UCase(Left(flName.Name, 1) = "D") Then
strFileName = strPath & "\" & flName.Name
xlSS1.Cells(2, intColCounter).Value = flName.Name
Workbooks.Open Filename:=strFileName, updatelinks:=False
Worksheets("S-S-1").Columns("B:B").Copy
xlSS1.Cells(1, intColCounter).PasteSpecial xlPasteValues
xlSS1.Cells(1, intColCounter).PasteSpecial xlPasteFormats
==> Workbooks(2).Close savechanges:=False <==
intColCounter = intColCounter + 1
End If
Next flName
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top