Results 1 to 6 of 6

Thread: selecting a row with a variable

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Los Angeles, CA
    Posts
    49

    selecting a row with a variable

    VB Code:
    1. For a = 4 To last
    2.     If Sheets("Software Personnel").Range("K" & a).Value = "M760" Then
    3.         Sheets("Software Personnel").Select
    4.         Rows(a).Select
    5.         Selection.Cut
    6.         Sheets("M760 Personnel").Select
    7.         Rows(m760Last + count).Select
    8.         ActiveSheet.Paste
    9.         count = count + 1
    10.     End If
    11. Next

    When I try to run this code... I get an error "1004 Select Method of Range class failed" and doesn't like this line:

    VB Code:
    1. Rows(a).Select

    Any ideas? Any different algorithms that would work?

    Thanks,
    Alex
    Last edited by LodBot; Jul 29th, 2003 at 12:50 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width