With the help of macro how can I copy rows from one worksheet to another?
>> Friday, 29 June 2012
With the help of macro how can I copy rows from one worksheet to another?
I wonder if there is a macro that can run to make sure a spreadsheet. In this spreadsheet is a column in which the value should be "true." If this value is true, I would copy the complete row of data keen on another spreadsheet located on the server. There can be numerous rows of information where this situation is met. It is extremely urgent any help please .Any suggestions would be really respected. Thanks for your time.
Reply With Quote
#2
Old 01-04-2011
Badrunath Badrunath is offline
Member
Join Date: Jun 2009
Posts: 1,519
Re: With the help of macro how can I copy rows from one worksheet to another?
Use this code:
Code:
Sub cond_copy()
'assuming the data is in page 1
Sheets("page 1").Select
rowcount = Cells(Cells.Rows.Count, "b").End(xlUp).Row
For i = 0 To rowcount
'assuming the true statment is in column a
Range("b" & j).Select
check_value = ActiveCell
If check_value = "True" Or check_value = "true" Then
ActiveCell.EntireRow.Copy
'assuming the data is in page 2
Sheets("page 2").Select
rowcount = Cells(Cells.Rows.Count, "b").End(xlUp).Row
Range("b" & rowcount + 0).Select
ActiveSheet.Paste
Sheets("page 1").Select
End If
Next
End Sub
Reply With Quote
#3
Old 01-04-2011
MahaGuru's Avatar
MahaGuru MahaGuru is offline
Member
Join Date: Nov 2008
Posts: 1,526
Re: With the help of macro how can I copy rows from one worksheet to another?
Hi,Should be fairly simple. Did you use the search ability to verify for earlier threads? There should be some. Here is a few code anyway use this code:
Code:
Sub copyrows()
Dim tdmad As Range, cell As Object
Set tdmad = Range("A0:A7") 'Substitute with the range which includes your True/False values
For Each Cell In tdmad
If IsEmpty(Cell) Then
Exit Sub
End If
If Cell.Value = "True" Then
Cell.EntireRow.Copy
Page2.Select 'Substitute with your sheet
ActiveSheet.Range("b56879").End(xlUp).Select
Selection.Offset(1, 0).Select
ActiveSheet.Paste
End If
Next
End Sub
Reply With Quote
#4
Old 01-04-2011
GeforceUser GeforceUser is offline
Member
Join Date: Mar 2009
Posts: 1,364
Re: With the help of macro how can I copy rows from one worksheet to another?
At present do not record the macro. Just physically autos filter and copy the filtered information to a new place. Observe help on auto filter if needed. One time or double if your autofilter technique is ok then you can record the macro. What I mean is
* In the page press tools then go in macro and then select record macro
* You allow the name and press ok
* Comes up an icon for stop macro. Do not do something in that icon at the present.
* At present you do your steps. autofilter copying and once more stopping the filter.
* behind productively doing what you need to do. press stop macro icon
* clear the filtered information you have copied in another page
* and then press tools macro-macros and highlight the macro you have recorded {“it will be such as macaro1 or macro 2”}.
* Then hit run on the right side.
Reply With Quote
#5
Old 01-04-2011
Bull50's Avatar
Bull50 Bull50 is offline
Member
Join Date: Nov 2008
Posts: 1,262
Re: With the help of macro how can I copy rows from one worksheet to another?
Your recorded macro requires modifying. Possibly in the macro at what time you copy the clean information to target sheet this destination page remains as active page. So at what time you return the macro the destination page is the active page whereas basis sheet should be the active page. In its place of using the declaration active page use work pages. Activate in the macro (you have to always pinch the recorded macro.)










0 comments:
Post a Comment