|
-
Jul 22nd, 2003, 11:36 AM
#1
Thread Starter
Member
selecting a row with a variable
VB Code:
For a = 4 To last
If Sheets("Software Personnel").Range("K" & a).Value = "M760" Then
Sheets("Software Personnel").Select
Rows(a).Select
Selection.Cut
Sheets("M760 Personnel").Select
Rows(m760Last + count).Select
ActiveSheet.Paste
count = count + 1
End If
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:
Any ideas? Any different algorithms that would work?
Thanks,
Alex
Last edited by LodBot; Jul 29th, 2003 at 12:50 PM.
-
Jul 22nd, 2003, 07:11 PM
#2
This is how I highlight a row.....hope it helps
Code:
oXLApp.Worksheets("Sheet1").Select
ActiveCell.EntireRow.Select
Selection.Delete Shift:=xlUp
-
Jul 24th, 2003, 10:54 AM
#3
Thread Starter
Member
-
Jul 29th, 2003, 12:51 PM
#4
Thread Starter
Member
VB Code:
For a = 1 to 20
Sheets("New Personnel").Range("BB" & a).EntireRow.Select
Selection.Cut
Selection.Delete Shift:=xlUp
Next
I get:
1004 Select method of Range class failed
and it doesn't like this line:
Sheets("New Personnel").Range("BB" & a).EntireRow.Select
any ideas?
Last edited by LodBot; Jul 29th, 2003 at 12:56 PM.
-
Jul 31st, 2003, 05:46 AM
#5
This works fine for me, have you declared a as an integer variable data type?
-
Aug 5th, 2003, 07:09 AM
#6
Fanatic Member
Is there a reason why Vlookup is not an option? Vlookup displays information from one cell by finding something in another. It's also be fast I would have thought.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|