Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Imported Data Not Replacing Existing Data - Excel 2007 Marilyn Excel Discussion (Misc queries) 0 April 27th 09 05:22 PM
imported data into excel Midas Excel Worksheet Functions 1 June 24th 06 11:38 AM
Outside Data Imported to Excel sabunabu Excel Discussion (Misc queries) 0 December 8th 05 02:15 PM
How Do I specify where XML data gets imported into Excel Diane Excel Discussion (Misc queries) 1 April 29th 05 06:00 PM
Edited Data Imported into Excel ExcelMonkey[_110_] Excel Programming 0 April 12th 04 03:23 AM


All times are GMT +1. The time now is 05:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"