Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Edited Data Imported into Excel
I have a sheet which imports data. The data that gets imported is no
spaced evenly. I want to be able to delete all the rows prior to th row that the word "Price" occurs in. That is, if A13 says "Price", would like to delete rows 1 to 12. "Price" only occurs in the Colum A. The problem I am having is that "price" is not occuring every 13 rows. It varies in the data. I was originally deleting the first 12 row within a loop but realized the uneven spacing of data was causing m problems. Thank-you -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Edited Data Imported into Excel
EM
Try this Sub DelRows() Dim cell As Range Dim FirstPrice As Boolean FirstPrice = False For Each cell In Range("A1:A50") If cell.Value = "Price" Then If FirstPrice Then Range("a1", cell.Offset(-1, 0)).EntireRow.Delete Exit For Else FirstPrice = True End If End If Next cell End Sub -- Dick Kusleika MVP - Excel Excel Blog - Daily Dose of Excel www.dicks-blog.com "ExcelMonkey " wrote in message ... Sorry quick caveat here. I have to delete all the rows prior to "price" occuring twice. That is, "price" may occur in row 6 and then again in row 13. I want to delete all the rows prior to the second occurence of "price". Thanks --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Imported Data Not Replacing Existing Data - Excel 2007 | Excel Discussion (Misc queries) | |||
imported data into excel | Excel Worksheet Functions | |||
Outside Data Imported to Excel | Excel Discussion (Misc queries) | |||
How Do I specify where XML data gets imported into Excel | Excel Discussion (Misc queries) | |||
Edited Data Imported into Excel | Excel Programming |