Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default A Macro for copy with selection.. (please help me)

Friends, how I can copy specific a specific row range in other sheets with
conditions special. ie:
copy from:
Sheet1: A B C D
1 W 100 200 300
2 400 500 600
3 700 800 900
4 W 1000 1100 1200
5 1300 1400 1500
.... (I not know how many rows there)

to Sheet2 (ONLY range Ax to Dx when Ax = "W")
A B C D
1 W 100 200 300
2 W 1000 1100 1200
....
Thanks, Iván


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default A Macro for copy with selection.. (please help me)


Sub SpecialCopy()
Sheets("Sheet2").Select
Range("A1").Select
Sheets("Sheet1").Select
Range("B1").Select

Do Until ActiveCell = ""
If ActiveCell.Offset(0, -1).Value = "W" Then
ActiveCell.EntireRow.Copy
Sheets("Sheet2").Select
ActiveCell.PasteSpecial
ActiveCell.Offset(1, 0).Select
Sheets("Sheet1").Select
End If
ActiveCell.Offset(1, 0).Select
Loop
End Sub

This should work,
Jorda

--
jordanct
-----------------------------------------------------------------------
jordanctc's Profile: http://www.excelforum.com/member.php...nfo&userid=676
View this thread: http://www.excelforum.com/showthread.php?threadid=27833

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default A Macro for copy with selection.. (please help me)

worksheets("Sheets1").Columns(1).SpecialCells(xlCo nstants) _
.EntireRow.copy _
Destination:=Worksheets("Sheet2").Range("A1")

--
Regards,
Tom Ogilvy

"Iván" wrote in message
...
Friends, how I can copy specific a specific row range in other sheets with
conditions special. ie:
copy from:
Sheet1: A B C D
1 W 100 200 300
2 400 500 600
3 700 800 900
4 W 1000 1100 1200
5 1300 1400 1500
.... (I not know how many rows there)

to Sheet2 (ONLY range Ax to Dx when Ax = "W")
A B C D
1 W 100 200 300
2 W 1000 1100 1200
....
Thanks, Iván




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default A Macro for copy with selection.. (please help me)

Jordan, thanks...., this solution is ok. in normal ranges, but I forget
to write that "W" lines are rows from a subtotal process.... In this case
the formula don't work.
What do you think, this row is not real?
Thanks, Ivan

"jordanctc" wrote:


Sub SpecialCopy()
Sheets("Sheet2").Select
Range("A1").Select
Sheets("Sheet1").Select
Range("B1").Select

Do Until ActiveCell = ""
If ActiveCell.Offset(0, -1).Value = "W" Then
ActiveCell.EntireRow.Copy
Sheets("Sheet2").Select
ActiveCell.PasteSpecial
ActiveCell.Offset(1, 0).Select
Sheets("Sheet1").Select
End If
ActiveCell.Offset(1, 0).Select
Loop
End Sub

This should work,
Jordan


--
jordanctc
------------------------------------------------------------------------
jordanctc's Profile: http://www.excelforum.com/member.php...fo&userid=6761
View this thread: http://www.excelforum.com/showthread...hreadid=278331


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
Selection copy and insert to other sheet (Macro) VLOOKUP fORMULA Excel Discussion (Misc queries) 8 March 27th 10 02:48 PM
Help creating a macro to copy and paste a certain selection Shu of AZ Excel Discussion (Misc queries) 0 January 8th 07 04:36 AM
Help creating a macro to copy and paste a certain selection Shu of AZ Excel Discussion (Misc queries) 0 January 7th 07 11:52 PM
Need a macro to Copy a selection and paste into a new email. Koolmist Excel Discussion (Misc queries) 3 February 20th 06 04:48 PM
Macro to Copy Selection to new Sheets Rashid Khan Excel Programming 0 June 30th 04 01:58 PM


All times are GMT +1. The time now is 05:13 PM.

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"