Consulting

Results 1 to 1 of 1

Thread: excel vba

  1. #1

    excel vba

    I want to extract data from one worksheet to another worksheet with criteria (i) Center(Alphabet) and (ii) between two dates in excel.

    I have use following code for this and i use input box for variable criteria(i) center.

    Sub mcopy()
    Call DeleteRowsBelow
    a = Worksheets("CRM").Cells(Rows.Count, 1).End(xlUp).Row
    
    Dim myModule As String
    myModule = Application.InputBox("Enter a Module")
    
    For i = 2 To a
        If Worksheets("CRM").Cells(i, 4).Value = myModule Then
    
            Worksheets("CRM").Rows(i).Copy
            Worksheets("MODCRM").Activate
            b = Worksheets("MODCRM").Cells(Rows.Count, 1).End(xlUp).Row
            
            Worksheets("MODCRM").Cells(b + 1, 1).Select
            ActiveSheet.Paste
            Worksheets("CRM").Activate
        End If
    Next
    
    Application.CutCopyMode = False
    'ThisWorkbook.Worksheets("CRM").Cells(1, 1).Select
    
    End Sub
    
    Sub DeleteRowsBelow()
        Worksheets("MODCRM").Rows(3 & ":" & Worksheets("MODCRM").Rows.Count).Delete
    End Sub


    In this code, i want to use center at particular center on CRM sheet (i.e. on $d$1 cell) and dates are at $h$1 and $g$1.

    Can any one help for solving this.





    Last edited by Aussiebear; 11-06-2021 at 02:50 AM. Reason: Posted to wrong sub forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •