Thread: pasting
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Geebee Geebee is offline
external usenet poster
 
Posts: 28
Default pasting

hi,

I am trying to paste copied data from a csv file into another workbook's
"Input" sheet, starting at row 265. Basically, I have the following:

Workbooks.Open "source.csv"
DisplayAlerts = False
If Range("A2").Value 0 Then 'file not empty
Range(Range("A2"), Range("M2").End(xlDown)).Select
Range(Range("A2"), Range("M2").End(xlDown)).Copy
Application.CutCopyMode = True 'prevent the following prompt: "There is a
large amount of information on the clipboard. Do yo uwant to be able to
paste this information into another program later?"
Application.ActiveWorkbook.Close savechanges:=False ' No need to save here
End If

'paste data from csv file, starting at row 265
Sheets("Input").Activate
Range(Range("A265"), Range("M265").End(xlDown)).Select
With ActiveSheet
.Range(.Range("A265"), .Range("M265").End(xlDown)).Copy _
Sheets("Input").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
End With

I am not able to get this to work. Nothing is being pasted. Can someone
tell me why, and how to fix this?

Thanks in advance,
geebee