[mso] XL VB:Find first and last
- From: "April Pace" <apace@xxxxxxxxxxxxxxxxxxxxx>
- To: <mso@xxxxxxxxxxxxx>
- Date: Tue, 30 Nov 2004 10:19:43 -0500
*********Resending this after cleaning up the garbage that came
out********
Range("A1:AZ60000").Activate
Selection.Sort Key1:=3DRange("A2"), Order1:=3DxlAscending,
Header:=3DxlGuess, _
OrderCustom:=3D1, MatchCase:=3DFalse, =
Orientation:=3DxlTopToBottom, _
DataOption1:=3DxlSortNormal
Cells.Find(What:=3D"Database", After:=3DActiveCell, =
LookIn:=3DxlFormulas, _
LookAt:=3DxlPart, SearchOrder:=3DxlByRows, =
SearchDirection:=3DxlNext,
MatchCase:=3DFalse, SearchFormat:=3DFalse).Activate
ActiveCell.Select
Range(Selection, Selection.Offset(0, 200)).Select
Range(Selection, Selection.Offset(1000, 0)).Select
Selection.Delete
Database: BC_PROD Check Register Page: 2
Database: BC_PROD Check Register Page: 3
Database: BC_PROD Check Register Page: 4
Database: BC_PROD Check Register Page: 5
Database: BC_PROD Check Register Page: 6
Entity Check # Check Date Vendor Invoice Number Amount Number
Approval
Entity Check # Check Date Vendor Invoice Number Amount Number
Approval
Entity Check # Check Date Vendor Invoice Number Amount Number
Approval
Entity Check # Check Date Vendor Invoice Number Amount Number
Approval
Entity Check # Check Date Vendor Invoice Number Amount Number
Approval
Entity Check # Check Date Vendor Invoice Number Amount Number
Approval
I need help figuring out how to write some VB. The code above is what I
have now, but I need to make it more specific. Right now the code says
find the 1st time you see the word "Database", make it the active cell,
and delete that row and every row below it. I am finding out that I may
have rows below the word "Database" the I will need to keep, so I need
to figure out how to get the code to find the first row with the word
"Database" and the last row with the word "Entity" and just delete those
rows. Any idea's? I'm sure this is probably a "Loop until" but I don't
know how to write it.
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, send an email to
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in
the subject line.
Or, visit the group's homepage and use the dropdown menu. This will also allow
you to change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to use the files section for sharing files with the group, send a
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with
instructions. Once you are a member of the files group, you can go here to
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************
Other related posts: