Results 1 to 10 of 10

Application or Object defined error

Threaded View

shrimic Application or Object defined... 02-20-2012, 12:44 PM
Leith Ross Re: Application or Object... 02-20-2012, 01:18 PM
shrimic Re: Application or Object... 02-20-2012, 01:35 PM
Leith Ross Re: Application or Object... 02-20-2012, 01:39 PM
shrimic Re: Application or Object... 02-20-2012, 01:50 PM
Leith Ross Re: Application or Object... 02-20-2012, 01:55 PM
shrimic Re: Application or Object... 02-20-2012, 02:19 PM
Leith Ross Re: Application or Object... 02-20-2012, 02:41 PM
shrimic Re: Application or Object... 02-20-2012, 02:08 PM
shrimic Re: Application or Object... 02-21-2012, 10:32 AM
  1. #1
    Registered User
    Join Date
    02-09-2012
    Location
    Manassas, Virginia, USA
    MS-Off Ver
    Excel 2007
    Posts
    30

    Application or Object defined error

    Hi Friends,

    I need to look for a match between Column A of 'DRAM' worksheet and Column A of 'Refer' worksheet and if a match is found then the row containing the match should be stored in a variable 'Cell1' and then my code must look for a string 'WS Group Totals:" in Column B of 'DRAM' sheet and the row containing the string must be stored in a variable Cell2. In the row containing Cell2 the values from Column D till the row end must be multiplied by 10080 and the result must be placed two rows below the last populated row in their respective columns. Once that is done my code must look for the next match of Column A in 'DRAM' and COLUMN A in 'Refer' worksheets and must do the calculation as the same as above. I have written the below code for the purpose but I am repeatedly getting Application or Object defined error...can someone please help me figure out the error...thank you very much..I have attached the original Workbook for your reference...

    Option Explicit
    
    
    Sub DRSummary()
    
    Dim PartRngWorkbook1DRAMSheeta As Range, PartRngWorkbook1DRAMSheetb As Range
    Dim cs As Variant, Cell1 As Long, Cell2 As Long, rngMultiply As Range, Cell4 As Long, Cell5 As Long
    Dim Cell6 As Long, PartRngWorkbook1Reference1 As Range, a As Variant, wsActive As Worksheet, intCols As Integer, rngValue As Range
    Const intMultiplier As Integer = 10080
    Dim ab As Worksheet, lastRow As Long
    
    Set PartRngWorkbook1DRAMSheeta = Worksheets("DRAM").Range("A3", Worksheets("DRAM").Range("A65536").End(xlUp))
    Set PartRngWorkbook1DRAMSheetb = Worksheets("DRAM").Range("B", Worksheets("DRAM").Range("B65536").End(xlUp))
    Set PartRngWorkbook1Reference1 = Worksheets("Refer").Range("A", Worksheets("Refer").Range("A65536").End(xlUp))
    Set ab = Worksheets("DRAM")
    
    For Each cs In PartRngWorkbook1DRAMSheeta
        
        If IsNumeric(Application.Match(cs.Value, PartRngWorkbook1Reference1, 0)) Then
            Cell1 = PartRngWorkbook1DRAMSheeta.Find(cs.Value).Row
           
            Cell2 = PartRngWorkbook1DRAMSheetb.Find("WS Group Totals:", Range("B", Cell1)).Row
            
          
           With ab
                intCols = .Cells(Cell2, .Columns.Count).End(xlToLeft).Column
                lastRow = .Rows(.Rows.Count).Row
                    Set rngMultiply = .Range(.Cells(Cell2, 4), .Cells(Cell2, intCols))
                    For Each rngValue In rngMultiply
                        .Cells(.Rows.Count, rngValue.Column).End(xlUp).Offset(2, 0).Value = intMultiplier * rngValue.Value
                    Next
            End With
        End If
    Next cs
    End Sub
    Attached Files Attached Files
    Last edited by shrimic; 02-20-2012 at 12:53 PM.

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