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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

specifying a 'row' range based on a value in the first row and last

Status
Not open for further replies.

t16turbo

Programmer
Mar 22, 2005
315
GB
I have the value "very Likely Projects" in the first row of a range I need to cut.
The last row contains "Very Likely Projects Total"

I have to select the range of rows, cut, and insert the cut cells on the row that contains "Prospects"

can anybody advise...
 
Hi
Do you have anything to start with? Initial attempts etc?

I'd suggest having a look at the Find method to help you identify the rows you need and using the macro recorder to see the kind of code generated by cutting and pasting data.

After a bit of editing you could end up with something like this where Row1, Row2 & Row3 are the rows you are looking for

Code:
    Rows(Row1 & ":" & Row2).Cut
    Sheets("Sheet2").Select
    Rows(Row3).Insert Shift:=xlDown
    Application.CutCopyMode = False


;-)
If a man says something and there are no women there to hear him, is he still wrong? [ponder]
How do I get the best answers?
 


t16turbo,

I would imagine that IF the first row contained very Likely Projects, and the last row contained very Likely Projects Totals, that each row in the range would ALSO contain very Likely Projects or at least it SHOULD.

Then it would be a simple sort, filter 'n' cut operation.

Skip,

[glasses] [red]Sign above the facsimile apparatus at the music publisher:[/red]
If it ain't baroque...
Don't FAX it![tongue]
 
thanks guys - that helped me sort it out.
I love it when VBA works for me!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top