# Copy row IF cell has two values Excel

June 16, 2011 at 16:47:14
Specs: Macintosh
 Writing a macro to copy a row and insert it underneath ONLY IF a cell contains a value that is more than two digits (need to look at example to understand).Example:1 1,2 1/1/11 Time (Dirty Bit), The Black Eyed Peas, The2 3 1/1/11 We R Who We R Ke\$ha You see int he second column first row, there is 1,2, so it need to copy that and insert it below. I have a code that is working for cells that have values higher than 10,11, Here it is:Sub Insert_Rows() Rw = 1 LastRow = 1000NxtChk: If Cells(Rw, "B") > (99) Then Rows(Rw).Select Selection.Copy Rows(Rw + 1).Select Selection.Insert Shift:=xlDown Rw = Rw + 1 NewRow = NewRow + 1 End If If Rw = LastRow + NewRow Then Exit Sub Rw = Rw + 1 GoTo NxtChkI'm not sure what kind of value is give by numbers such as 1,2 any tips?End Sub

See More: Copy row IF cell has two values Excel

#1
June 16, 2011 at 20:12:40
 Never mind, just made it do a search on that row for a ",". Thanks

Report •
Related Solutions