Go Back   TechArena Community > Software > Windows Software
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



With the help of macro how can I copy rows from one worksheet to another?

Windows Software


Reply
 
Thread Tools Search this Thread
  #1  
Old 01-04-2011
Member
 
Join Date: Feb 2011
Posts: 46
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
Member
 
Join Date: Jun 2009
Posts: 1,518
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
Member
 
Join Date: Nov 2008
Posts: 1,514
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
Member
 
Join Date: Mar 2009
Posts: 1,360
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
Member
 
Join Date: Nov 2008
Posts: 1,259
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.)
Reply With Quote
Reply

  TechArena Community > Software > Windows Software
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "With the help of macro how can I copy rows from one worksheet to another?"
Thread Thread Starter Forum Replies Last Post
Macro to find the min value of the rows Farzana Windows Software 4 27-05-2011 07:29 AM
How To Copy Rows having Colored Cells by Macro dogaman Windows Software 3 16-11-2010 03:23 AM
Merging duplicate names not rows copy rows into new workbook each time VBA Excel 2003 awkwardsmile Software Development 2 09-07-2009 08:57 AM
Excel macro variable to delete rows JPGargoyle Windows Software 2 22-06-2009 11:26 AM
Delete blank Rows and Columns in a Worksheet monsitj Windows Software 0 05-01-2009 10:32 AM


All times are GMT +5.5. The time now is 02:23 AM.