Results 1 to 5 of 5

Copy cell values with 'if' statement throws error

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-19-2010
    Location
    UK.
    MS-Off Ver
    Excel 2007
    Posts
    142

    Unhappy Copy cell values with 'if' statement throws error

    I'm trying to copy cell values from the next sheet to the currently active sheet but the 'if' condition throws the following error.
    Any idea what I'm missing or how to define the variable to eliminate the error?
    Perhaps there is a better way to do this, any help would be appreciated.
    Run-time error 91
    Object or with block variable not set
    If ActiveSheet.Next.Range("B2") = "Name:" Then
    ActiveSheet.Cells(2, 3) = ActiveSheet.Next.Range("C2")
    ActiveSheet.Cells(3, 3) = ActiveSheet.Next.Range("C3")
    ActiveSheet.Cells(4, 3) = ActiveSheet.Next.Range("C4")
    ActiveSheet.Cells(5, 3) = ActiveSheet.Next.Range("C5")
    ActiveSheet.Cells(5, 6) = ActiveSheet.Next.Range("F5")
    End If
    Last edited by Mayweed; 02-19-2011 at 10:25 PM.

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