Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-07-2013, 02:23 AM
mikec mikec is offline paste fails error 1004 in VBA Excel 2010 Windows XP paste fails error 1004 in VBA Excel 2010 Office 2010 32bit
Advanced Beginner
paste fails error 1004 in VBA Excel 2010
 
Join Date: Nov 2012
Posts: 30
mikec is on a distinguished road
Default paste fail

Sorry; my partly developed code is as below. It doesn't work yet because I have to develop separate loop counters for the two tables before calling the InserLine sub. What I can say is that the ListRows.Add line does not clear the clipboard of previous copy entries. I will have to go off line now but will be happy to continue the conversation later unless you've had enough!


Code:
Sub Macro1() Dim lnN As Integer 'Dim lcWasAt As String Sheets("Diary").Activate Range("SummerCompTable").Select For lnN = 1 To Selection.ListObject.ListRows.Count Range("SummerCompTable").Range(Cells(lnN, 4), Cells(lnN, 4)).Select Select Case ActiveCell Case "Both" Call InsertLine("POYCompTable", lnN) Call InsertLine("ScratchCompTable", lnN) Case "POY" Call InsertLine("POYCompTable", lnN) Case "Scratch" Call InsertLine("ScratchCompTable", lnN) Case Else MsgBox "Data error in 'Where' column" Exit Sub End Select Next lnN End Sub Sub InsertLine(lcDiaryName As String, lnLoopNo As Integer) With Range(lcDiaryName) .ListObject.ListRows.Add (lnLoopNo) Range("SummerCompTable").Range(Cells(lnLoopNo, 1), Cells(lnLoopNo, 3)).Copy .ListObject.ListRows(lnLoopNo).Range.PasteSpecial End With End Sub

Last edited by macropod; 05-07-2013 at 02:30 AM. Reason: Added code tags & formatting
Reply With Quote
Reply

Tags
error1004, failure, paste



Similar Threads
Thread Thread Starter Forum Replies Last Post
Paste special an Excel range into Outlook as an Excel Worksheet charlesh3 Excel Programming 3 02-04-2013 04:33 PM
paste fails error 1004 in VBA Excel 2010 Outlook 2010 & WM 6.5 - recurring appt fails to sync ghumdinger Outlook 1 08-11-2012 02:20 PM
paste fails error 1004 in VBA Excel 2010 Run time error 1004 yonasan Excel Programming 3 06-12-2012 11:08 PM
paste fails error 1004 in VBA Excel 2010 runtime error 1004 gbaker Excel Programming 11 06-06-2012 05:23 AM
paste fails error 1004 in VBA Excel 2010 Microsoft office 2010 error 2908 and error 1935 !!!!!!heeeeellpppp!!!!!!!!! bennypryde Office 1 01-05-2012 03:33 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft