Results 1 to 13 of 13

Thread: VBA code to paste data to a row with today's date in column A in another sheet

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    VBAX Regular
    Joined
    Aug 2017
    Posts
    6
    Location
    Had a go in line with your last message -

    Sub cashMISforum()
    '
        Dim Col 'Variables not explicitly Typed are of Type Variant
        Dim Fut_Clr 'Variants are required for Array operations
        Dim STL
             
        With Sheets("CASH")
            Col = .Range("E5:G5").Value 'Sets variable to an array of values
            Fut_Clr = .Range("E6:G6").Value
            STL = .Range("E7:G7").Value
        End With
         
        With Sheets("CASH FAILS MIS")
                Set RowFound = Sheets("CASH FAILS MIS").Cells.Find(CDate(selecteddate)).Row
                selecteddate = Sheets("CASH").Range("J1")
            .Cells(NR, "A").Value = Date
            .Cells(NR, "B").Resize(, 3) = Col 'Resize(Rows, Columns) makes the Range Rows tall and Columns Wide
            .Cells(NR, "E").Resize(, 3) = Fut_Clr 'Resize is required to Let Range = Values Array
            .Cells(NR, "H").Resize(, 3) = STL
        End With
    End Sub
    but get a run time error '91
    object variable or with block variable not set

    Apologies if I am new to VBA. I am not familiar with this error.

    Thanks

    Juddy
    Last edited by mdmackillop; 08-29-2017 at 12:31 PM. Reason: Code tags added

Posting Permissions

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