Results 1 to 3 of 3

Error when No data to paste

Threaded View

  1. #1
    Registered User
    Join Date
    05-26-2004
    Posts
    61

    Error when No data to paste

    Hi:

    in Excel 2000 spk3, I have a sub that copies a range and pastes it somewhere else. It works fine if there is data to be pasted but if the range is empty is error out. Is there a way to bypass the error and maybe have a msgbox come up and adivise the user?

    this is a portion of my rookie code:

    Range("BK5").Select
    Range(ActiveCell, ActiveCell.End(xlDown)).Select
    Selection.Cut
    '
    Range("A5").Select
    Do
    If ActiveCell.Select <> "" Then
    ActiveCell.Offset(1, 0).Select
    End If
    Loop Until ActiveCell = ""
    '
    ActiveSheet.Paste

    When it goes to ActiveSheet.Paste, if it there's no data to paste it errors out.


    thanks
    Last edited by halem2; 12-19-2005 at 04:50 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