Macro to copy cell values to row below

S

Scott Wagner

I've posted twice for help on a project I'm working on and have had no
replies, guessing that I am asking for too much. Thought I would break this
down into smaller parts.

I have a product listing that includes a summary line (marking, qty, item
number) and multiple detail lines below. I want to change the first values
in the two cells following the summay line and replace with the same
information from the summary line. Ideally I only want to do this if the
item number field contains a specific keyword "Panelboard".

Any ideas?

Thanks,

Scott

Here is a link to my last post if you would like to see where this is
ultimately leading. If this isn't possible please let me know.

http://www.microsoft.com/office/com...c1af86-6aa9-44ea-b554-325da1ca2640&sloc=en-us
 
T

Tom Ogilvy

Sub AddData()
Dim rng As Range, fAddr As String
Set rng = Columns(3).Find(What:="Panelboard", _
After:=Range("C1"), LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng Is Nothing Then
fAddr = rng.Address
Do
rng.Offset(1, 0).Resize(2, 1).EntireRow.Insert
rng.Offset(1, -2).Resize(2, 2).Value = rng.Offset(0, -2).Resize(1,
2).Value
rng.Offset(1, 0).Value = "Black Box"
rng.Offset(2, 0).Value = "Trim"
Set rng = Columns(3).FindNext(rng)
Loop While rng.Address <> fAddr
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top