Results 1 to 6 of 6

PLEASE HELP Continuous 1004 Error

Threaded View

  1. #1
    Registered User
    Join Date
    11-10-2016
    Location
    Dallas, Texas
    MS-Off Ver
    Office 2013
    Posts
    5

    PLEASE HELP Continuous 1004 Error

    I can't seem to get excel 2013 to recognize some of my objects properly, especially when I am trying to pass values, please help! This sub is supposed to take a list of purchasers in single rows and separate them out to individual rows so they can be used in a mail merge.

    Am especially having trouble with this line, I want to take a range and simply copy it to range in the next sheet based on where the counter is in the loop:
    Sheets(2).Range(Cells(mergeRow, 1), Cells(mergeRow, 7)) = Sheets(1).Range(Cells(i, 5), Cells(i, 11))
    Sub UTWMailMerge2()
    '
    '1: Loop through each row and see if there is a recipient address 1, recipient address 2, or recipient address 3
    '2: If none, use purchaser address
    '3: Take information and display on new line for each recipient in row
    
    Dim i As Integer
    Dim lastRow As Integer
    Dim mergeRow As Integer
    
    mergeRow = 1
    lastRow = Range("A" & Rows.Count).End(xlUp).Row
    
    'Loop through each row and see if there is a recipient address 1, recipient address 2, or recipient address 3
    For i = 2 To lastRow
        If Not IsEmpty(Sheets(1).Cells(i, 7).Value) Then
        'I keep receiving an error on this below
        Sheets(2).Range(Cells(mergeRow, 1), Cells(mergeRow, 7)) = Sheets(1).Range(Cells(i, 5), Cells(i, 11))
        mergeRow = mergeRow + 1
        End If
    Next i
    End Sub

    Any help would be appreciated, thanks!
    Jordan
    Last edited by alansidman; 11-10-2016 at 02:36 PM. Reason: code tags added

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Runtime error '1004': Paste special method of range class error.
    By Daryl Zer0 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-05-2014, 01:44 AM
  2. [SOLVED] Sort Macro Run-time error '1004': Application/Object-defined error.
    By sam1212 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2014, 10:05 AM
  3. [SOLVED] VBA Error: Runtime Error 1004: AutoFilter method of Range class failed
    By jl22stac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2013, 07:27 PM
  4. [SOLVED] Getting Error 1004 Object or Application Defined Error - Code to rearrange data
    By BlazzedTroll in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-10-2013, 12:10 PM
  5. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  6. Error 75 File/Path access error, sometimes Error 1004
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-16-2011, 02:35 PM
  7. Replies: 2
    Last Post: 10-04-2006, 11:37 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1