Results 1 to 21 of 21

Value = Value error

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,086

    Value = Value error

    I'm trying a simple macro, and am not sure why I'm getting an error. The macro is below.
    Sub DoWPR()
    'This one is specific to "TodaysWPR.xls"; Replaces blanks in Justification column with line Descriptions
    Dim LastRow As Long
    LastRow = Range("A" & Rows.Count).End(xlUp).Row 'this tells where our last row is
    
    
        Columns("X:Z").NumberFormat = "General"
        Range("Z1:Z" & LastRow).FormulaR1C1 = "=IF(ISTEXT(RC[-2]),RC[-2],RC[-21])"
        Columns("X:X").Value = Columns("Z:Z").Value
        Columns("Z:Z").ClearContents
    End Sub
    The error occurs when trying to copy the value from column Z into column X. Besides the "Columns" method above, I've also tried using
    Range("X1:X" & LastRow).value =Range("Z1:Z" & LastRow).value
    Both ways I get a runtime 1004, Application Defined or Object defined error.

    The macro lives in my Personal.xls, and I'm running it on TodaysWPRs.xls. Do I need to declare a sheet name or anything? The first two lines work just fine.
    Last edited by jomili; 10-21-2011 at 10:04 AM.

Thread Information

Users Browsing this Thread

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

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