Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 82
Default Macro to copy cell values to row below

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/comm...640&sloc=en-us


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro to copy cell values to row below

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


--
Regards,
Tom Ogilvy


"Scott Wagner" wrote in message
...
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/comm...640&sloc=en-us




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 82
Default Macro to copy cell values to row below

Tom,

You are a stud!

Thank you very much!

Happy New Year

Scott

"Tom Ogilvy" wrote:

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


--
Regards,
Tom Ogilvy


"Scott Wagner" wrote in message
...
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/comm...640&sloc=en-us





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with macro to copy, paste, and clear cell values Anthony[_5_] Excel Discussion (Misc queries) 8 December 21st 09 02:11 PM
copy paste values macro Wanna Learn Excel Discussion (Misc queries) 5 July 21st 09 04:44 PM
Copy values from a cell based on values of another cell Spence10169 Excel Discussion (Misc queries) 4 January 13th 09 10:01 AM
macro - copy values only JQ[_2_] Excel Programming 1 July 23rd 04 03:52 PM
Copy & Paste values macro...almost there? ste mac Excel Programming 5 November 2nd 03 10:49 PM


All times are GMT +1. The time now is 11:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"