Results 1 to 7 of 7

Need to add data to table in result sheets

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-10-2011
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    176

    Need to add data to table in result sheets

    Hi,

    I have data in table format in sheet1 but when I run the below code its not copying the result data in table format (in received sheet). Could any one please have a look and help me?

    Thanks in advance for your help!!

    
    Sub copy_data()
      
      p = InputBox("Please enter date", "Enter Start Date")
      q = InputBox("Please enter date", "Enter End Date")
      
      Application.ScreenUpdating = False
      With Sheets("Sheet1")
        If Not Evaluate("ISREF('Received'!A1)") Then
          Sheets.Add(After:=Sheets("Sheet1")).Name = "Received"
        Else
          Sheets("Received").UsedRange.ClearContents
        End If
        
        .Rows(1).Copy Sheets("Received").Rows(1)
    
        On Error Resume Next
    
        With .UsedRange
          .AutoFilter 12, ">" & CLng(CDate(p & " 23:59")), xlAnd, "<" & CLng(CDate(q & " 00:00"))
          .Offset(1).Copy Sheets("Received").Cells(2, 1)
          .AutoFilter
    
      End With
      
       Sheets("Received").Columns.AutoFit
    
      Application.ScreenUpdating = True
    End Sub
    Regards,
    Humac
    Last edited by humacdeep; 02-20-2012 at 05:58 PM. Reason: Solved

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1