Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro for copying entire raw

How can I code a VBA macro to copy entire raw of a perticuler text in column B and paste in the sheet named Output? I mean macro should filterout the raws of a name say mac and then copy only that filtered raw and paste to the sheet named mac

Any help is appreciated
Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro for copying entire raw

Dim rng as Range
set rng = cells.Find("mac")
if not rng is nothing then
rng.EntireRow.copy Destination:=worksheets("Output"). _
Cells(rows.count,1).End(xlup)(2)
end if

If you want to copy it to Mac instead of output, then change output to mac

If you want to look in only one column, then change cells to columns(3) for
example.

--
regards,
Tom Ogilvy

Mac wrote in message
...
How can I code a VBA macro to copy entire raw of a perticuler text in

column B and paste in the sheet named Output? I mean macro should filterout
the raws of a name say mac and then copy only that filtered raw and paste to
the sheet named mac.

Any help is appreciated.
Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro for copying entire raw

Thanks Tom for your superfast response. I could not imagine that somebody can be so fast atleast in helping others.
There are two problems in the code.
1. Macro should go through all the raws in the sheet, search for the name1 in col B and all the raws having name1 in col B
to be copied in sheet already there in that name.
2. Then macro will search for the next name in col B, anain copy the raws having that name in col B in the sheet already there
in that name.
3. Simmilarly it should search for all the names in the col B and copy it to the sheet already there in that name.

Pl note that the col B can have the same names repeated many times( This is name of our salesman)
I tried to modify your code to get the above result but failed to assign the cell content to the destination.
Request a bit more help please.

Thanks again,
Mac.


----- Tom Ogilvy wrote: -----

Dim rng as Range
set rng = cells.Find("mac")
if not rng is nothing then
rng.EntireRow.copy Destination:=worksheets("Output"). _
Cells(rows.count,1).End(xlup)(2)
end if

If you want to copy it to Mac instead of output, then change output to mac

If you want to look in only one column, then change cells to columns(3) for
example.

--
regards,
Tom Ogilvy

Mac wrote in message
...
How can I code a VBA macro to copy entire raw of a perticuler text in

column B and paste in the sheet named Output? I mean macro should filterout
the raws of a name say mac and then copy only that filtered raw and paste to
the sheet named mac.
Any help is appreciated.

Thanks.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Macro for copying entire raw

You may want to look at Debra Dalgleish's site:

http://www.contextures.com/excelfiles.html

There are a couple of files you may want to steal from:

Create New Sheets from Filtered List -- uses an Advanced Filter to create
separate sheet of orders for each sales rep visible in a filtered list; macro
automates the filter. AdvFilterRepFiltered.xls 35 kb

Update Sheets from Master -- uses an Advanced Filter to send data from
Master sheet to individual worksheets -- replaces old data with current.
AdvFilterCity.xls 55 kb

Mac wrote:

Thanks Tom for your superfast response. I could not imagine that somebody can be so fast atleast in helping others.
There are two problems in the code.
1. Macro should go through all the raws in the sheet, search for the name1 in col B and all the raws having name1 in col B
to be copied in sheet already there in that name.
2. Then macro will search for the next name in col B, anain copy the raws having that name in col B in the sheet already there
in that name.
3. Simmilarly it should search for all the names in the col B and copy it to the sheet already there in that name.

Pl note that the col B can have the same names repeated many times( This is name of our salesman)
I tried to modify your code to get the above result but failed to assign the cell content to the destination.
Request a bit more help please.

Thanks again,
Mac.

----- Tom Ogilvy wrote: -----

Dim rng as Range
set rng = cells.Find("mac")
if not rng is nothing then
rng.EntireRow.copy Destination:=worksheets("Output"). _
Cells(rows.count,1).End(xlup)(2)
end if

If you want to copy it to Mac instead of output, then change output to mac

If you want to look in only one column, then change cells to columns(3) for
example.

--
regards,
Tom Ogilvy

Mac wrote in message
...
How can I code a VBA macro to copy entire raw of a perticuler text in

column B and paste in the sheet named Output? I mean macro should filterout
the raws of a name say mac and then copy only that filtered raw and paste to
the sheet named mac.
Any help is appreciated.

Thanks.





--

Dave Peterson

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
Conditional copying of entire row across worksheets Marish New Users to Excel 1 October 10th 08 08:16 AM
Copying/Linking Entire Workbook TomP Excel Discussion (Misc queries) 2 October 6th 08 10:09 PM
Copying formatting of entire sheet Diamontina Cocktail New Users to Excel 5 June 27th 07 10:50 PM
Copying entire worksheets Todd Nelson Excel Discussion (Misc queries) 2 August 31st 05 06:50 PM
copying conditional formatting to an entire column MaryMalone Excel Discussion (Misc queries) 1 November 30th 04 04:04 AM


All times are GMT +1. The time now is 03:52 PM.

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

About Us

"It's about Microsoft Excel"