"Dave Peterson" wrote:
Glad you got it working.
Does this mean that you modified the code to look for adios and deleted rows
based on that found cell?
It seems like it should work.
LMIV wrote:
<<snipped
Hi, Dave
as usual, many activities underway, but clearly your code has made a huge
difference; now, in terms of further automation you can see that what I am
doing is fairly simply: you get to a row with information on a car model
year, open a fresh line for additional information, input it, and so on.
In this next pice of code i have combined parts of your macrodave with
direct recording portions to achieve the placement of the data on the
previous line right onto the newly opened one, such as a duplication would
do; however this is not working due to some compile error in the second
offset code line. If this can be done, with minor updfates/changes one can
follow up on eBay car auction details very quickly. This is the currect
testmacrodave:
Sub TESTNEWCALC()
'
' TESTNEWCALC Macro
' Macro recorded 2/13/2005 by Don Davis
'
' Keyboard Shortcut: Ctrl+m
'
' ADDEDMACRODAVE Macro
' Macro recorded 2/9/2005 by Don Davis
Dim FoundCell As Range
Dim FirstAddress As String
Dim wks As Worksheet
Dim HowManyRowsBelow As Long
Dim myStrings As Variant
Dim iCtr As Long
HowManyRowsBelow _
= Application.InputBox("How many rows below the foundcell?", _
Type:=1)
HowManyRowsAbove _
= Application.InputBox("How many rows above the foundcell?",
Type:=2)
If HowManyRowsBelow < 1 Then
Exit Sub
End If
'(this adds an empty line below found cell line) keep adding as many as
you want
myStrings = Array("hola", "hola01", "hola02", "hola03", _
"hola04", "hola05", "hola06")
Set wks = ActiveSheet
With wks
For iCtr = LBound(myStrings) To UBound(myStrings)
With .UsedRange
Set FoundCell = .Cells.Find(What:=myStrings(iCtr), _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
If FoundCell Is Nothing Then
'do nothing
Else
FirstAddress = FoundCell.Address
Do
FoundCell.Offset(HowManyRowsBelow).EntireRow.Inser t
FoundCell.Ofsset(HowManyRowsAbove).EntireRow.Selec t
ActiveSheet.Paste
Set FoundCell = .FindNext(FoundCell)
Loop While Not FoundCell Is Nothing _
And FoundCell.Address < FirstAddress
End If
End With
Next iCtr
End With
End Sub
Again thank you for your tremendous assistance, which I hope you enjoy
giving...
|