Consulting

Results 1 to 5 of 5

Thread: Repeat code for each row

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Dec 2017
    Posts
    12
    Location

    Repeat code for each row

    I am new at working with VBA and have found online some VBA code to copy cell range value from a formula then delete the formula and paste the value in the cells.

    And it works fine but i would like it to do now is if Cell B10 ="L" to run the VBA code and also repeat the code for each row. my current last row is 352

    Sub Copy_Paste_Remove_Formula()
        Dim smallrng As Range
        For Each smallrng In Sheets("Job Quote Hours").Range("j10:EO10").Areas
    
            With smallrng
                .Cells.Copy
                .Cells.PasteSpecial xlPasteValues
                .Cells(1).Select
            End With
            Application.CutCopyMode = False
        Next smallrng
        
        For Each smallrng In Sheets("Job Quote Hours").Range("J10:EO10").Areas
            
            With smallrng
                .Value = .Value
            End With
        Next smallrng
    End Sub
    Last edited by SamT; 01-11-2018 at 04:49 PM.

Posting Permissions

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