Prev: Set certain cells to print and others not to print
Next: Filling right header/footer with barcode
From: JeffF on 17 Mar 2010 10:22 I'd appreciate some help in creating a macro to delete rows. Here's what I need: 1) Delete rows 1-13 2) Then find all rows that are highlited blue and delete them 3) Then find all rows that include the text "Distr" and delete them Suggestions? Thanks in advance.
From: Don Guillett on 17 Mar 2010 11:13 Tell us how the rows came to be blue... -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett(a)gmail.com "JeffF" <JeffF(a)discussions.microsoft.com> wrote in message news:863D165C-D100-42E5-9294-3569F1829DF0(a)microsoft.com... > I'd appreciate some help in creating a macro to delete rows. > Here's what I need: > 1) Delete rows 1-13 > 2) Then find all rows that are highlited blue and delete them > 3) Then find all rows that include the text "Distr" and delete them > > Suggestions? > Thanks in advance. >
From: Mike H on 17 Mar 2010 11:44 Jeff, Where we we look for "Distr", anywhere on the sheet, in a particular column? -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "JeffF" wrote: > I'd appreciate some help in creating a macro to delete rows. > Here's what I need: > 1) Delete rows 1-13 > 2) Then find all rows that are highlited blue and delete them > 3) Then find all rows that include the text "Distr" and delete them > > Suggestions? > Thanks in advance. >
From: Hakyab on 17 Mar 2010 11:51 For 1: mysheet.Range("A1:A13").entirerow.delete for 3: dim c as range set c = mysheet.cells.find "Descr" do until c is nothing c.entirerow.delete set c = nothing set c = mysheet.cells.findnext loop // Find has more parameters which I ignored. Sorry cannot help as easily with your question 2. Find should be able to get specific formatting, I just do not know. Hope this helps, "JeffF" wrote: > I'd appreciate some help in creating a macro to delete rows. > Here's what I need: > 1) Delete rows 1-13 > 2) Then find all rows that are highlited blue and delete them > 3) Then find all rows that include the text "Distr" and delete them > > Suggestions? > Thanks in advance. >
From: JeffF on 17 Mar 2010 13:28 Thanks for the replies all. For #2, its actually not "Distr", it is "District" and it is only in column A. So I would want it to go: search in column A for the word "District"; when found, delete the row it is in; repeat until no more found. How they became blue?... this is an export from a web database. The export adds all districts to one worksheet. They put that blue header row and a few blank rows at the beginning of each district. We don't care about separating them by districts so we just want all of the data to be contiguous. And, we can't properly filter if those header rows are in the way. If you could say "start the macro on row 5 and delete any row where you find the phrase "Facility Name" and don't repeat" that would do it as well, as "Facility Name" is one of the headers that I doubt would ever appear as real text in the worksheet. Thanks again, Jeff
|
Next
|
Last
Pages: 1 2 3 Prev: Set certain cells to print and others not to print Next: Filling right header/footer with barcode |