I just learned how to add in Excel a couple months ago and, although I'm doing the best I can with google, VBA is not easy
for me to work with yet. So, while I certainly appreciate any sort of help, explanation-heavy answers would be doubly
The excel file I've attached should explain it far more clearly than I can in words, but I'll try to
summarize. I need to take a selection of cells and insert them into a table wherever text from a range show up.
Now, I should be - and have been - able to select the cells I want to insert and use the find method to find where to put
them. Basically, find all instances of "packageA" and insert; I have a macro for this in the example worksheet. The problem
is, I have a lot of different things to find. It needs to also insert on all the packageB's and C's and so on for a good 50
more, AND more are being added continuously. So, I can't just duplicate the macro for packageB and be done with it.
Here's what I'm using to find and insert:
Dim rFoundCell As Range
Dim LastCell As Range
Dim FirstAddr As String
Set LastCell = .Cells(.Cells.Count)
Set rFoundCell = Range("B1:B1195").Find(What:="PackageA", After:=LastCell)
If Not rFoundCell Is Nothing Then
FirstAddr = rFoundCell.Address
Do Until rFoundCell Is Nothing
Set rFoundCell = Range("B1:B1195").FindNext(After:=rFoundCell)
Selection.Offset(0, -1).Insert Shift:=xlDown
If rFoundCell.Offset(-4, 0).Address = FirstAddr Then
If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
Simply, instead of using find method to find one thing, I need to find anything that is in a range.
I imagine I can figure out this next part on my own, but, after it's done doing that it needs to go back through and
clear out blank rows. Some of the inserts leave one or several blank rows at the top, depending on which type of package they
have been inserted on top of.
Seems like it should be so simple but I've spent ages without figuring it
out...guess I need more grounding in VBA first.
http://www.mrexcel.com/forum/showthr...54#post3107254, hope that's ok!