Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

couple of excel q`s

Status
Not open for further replies.

SQLScholar

Programmer
Joined
Aug 21, 2002
Messages
2,127
Location
GB
Hey.

I have a couple of Excel Q`s

1) If i have a list where every other line is blank. Is there a way i can make a macro to delete them. Every time i record one, it selects the same line (i.e the first one) because it selecting it on the line not my movement... i.e. 2 lines down.

2) Is there any way to make a column which says "yes" or "no" depending whether there is duplication on a certain column ie.

A 1 Yes
B 2 No
C 2 No
A 3 Yes
D 5 No
F 7 No
G 8 No

So... ignoring the rest of the row, just becuase A appears twice (it could be 3,4,ect) it says yes

Thanks in Advance

Dan ----------------------------------------
There are 2 types of computer, the prototype and the obsolete!!
 
1) Yes - would suggest using the Autofilter method
This will delete all rows where there are blanks in column A, for a dataset in A:M

Sub DelBlankRows()
With ActiveSheet
lRow = .Range("A65536").End(xlUp).Row
With .Columns("A:M")
.AutoFilter Field:=1, Criteria1:="="
End With

With .Range("A2:M" & lRow)
.SpecialCells(xlCellTypeVisible).EntireRow.Delete Shift:=xlUp
End With
.Range("A1").Select
.AutoFilterMode = False
End With
End Sub
Rgds
Geoff

Vah! Denuone Latine loquebar? Me ineptum. Interdum modo elabitur
 
As foryour point 2: might this work?

enter in cell C1 (replaces the Yes/No's) & copy down:
Code:
=IF(COUNTIF($A$1:$A$8,A1)>1,"Yes","No")
tests to see whether the contents of A1 occur more than once in the range. If true, then put YES in cell. If not, put NO

HTH

Cheers
Nikki
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top