[thelist] Excel, VBA, Gurus? [Slightly OT]
Ken Kogler
ken.kogler at cph.org
Tue Jul 16 10:15:00 CDT 2002
Have you tried:
Rows( x & " : " & x ).Select
Seems like a syntactical thing. You could also do the concatenation outside
of that statement, like this:
row = x & " : " & x
Rows(row).Select
HTH,
--ken
-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Jay Blanchard
Sent: Tuesday, July 16, 2002 10:08 AM
To: thelist at lists.evolt.org
Subject: [thelist] Excel, VBA, Gurus? [Slightly OT]
Good day!
I am working on a spreadsheet that is to be displayed in a web browser on
the fly that has some duplicate rows. Due to the nature of the data I cannot
do a DISTINCT, so I want to rid myself of duplicate rows via an Excel macro,
thus far;
Sub dup_delete()
Rowcount = 3500
x = 2
y = 1
While Rowcount > 0
If (Range("A" & x).Select) = (Range("A" & y).Select) Then
Rows(" x : x ").Select
Selection.Delete Shift:=xlUp
End If
x = x + 1
y = y + 1
Rowcount = Rowcount - 1
Wend
End Sub
The statement 'Rows(" x : x ").Select' throws a type mismatch errors. I
have tried 'Rows(" & x & : & x & ").Select' and every other concatenation I
could think of. Under normal circumstances this row would read (if I
selected row 2 of the spreadsheet for instance 'Rows("2:2").Select' . Of
course I need to increment the number when needed.
I have searched MSDN and other resources, but cannot find an answer. Can
variables not be used in a call like this?
TIA!
Jay
*************************************
* Want to meet other PHP developers *
* in your area? Check out: *
* http://php.meetup.com/ *
* No developer is an island ... *
*************************************
--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !
More information about the thelist
mailing list