Consulting

Results 1 to 3 of 3

Thread: Solved: Repeat B2 values based on rows on column A

  1. #1

    Solved: Repeat B2 values based on rows on column A

    Dears,

    Kindly share with me: VBA code to repeate B2 value; repetition number equal to Column_A rows

  2. #2
    VBAX Expert Dave's Avatar
    Joined
    Mar 2005
    Posts
    836
    Location
    It's kind of difficult to understand your needs. Here's abit of code that may get you strarted. Dave
    [VBA]
    Dim LastRow As Integer, Cnt As Integer
    With Sheets("Sheet1")
    LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
    End With
    For Cnt = 3 To LastRow
    Sheets("Sheet1").Cells(Cnt, "B") = Sheets("Sheet1").Range("B" & 2)
    Next Cnt
    [/VBA]

  3. #3
    VBAX Newbie
    Joined
    Nov 2011
    Posts
    4
    Location
    you can also try with this code[VBA] Dim LR As Integer, i As Integer

    LR = Range("A" & Rows.Count).End(xlUp).Row

    For i = 3 To LR
    Cells(i, "B").Value = Range("B2").Value
    Next i[/VBA]

Posting Permissions

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