Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Increment()
- Dim startValue
- startValue = Cells(15, 5).Value
- For i = 1 To 10 Step 1
- Cells(i, 5).Value = startValue
- startValue = startValue + 1
- Next i
- End Sub
- Sub tgr()
- Dim ws As Worksheet
- Dim rDest As Range
- Dim lCount As Long
- Dim sValue As String
- Set ws = ActiveWorkbook.ActiveSheet
- Set rDest = ws.Range("H3")
- With ws.Range(rDest, ws.Cells(ws.Rows.Count, rDest.Column).End(xlUp))
- If .Row >= rDest.Row Then .ClearContents 'Clear previous results (if any)
- End With
- lCount = Val(ws.Range("C3").Value)
- sValue = ws.Range("F3").Value
- If lCount > 0 Then rDest.Resize(lCount) = sValue
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement