How to clear rows before copying data

S

steve1040

I have modified the following macro which I got from another posting.

2 questions
1. How do I clear all the data in UpdateListing starting at row 2?

2. In column A of UpdateListing I want the word "UPDATE" for each row.
Is it possible to add the word to V (the Array)?
I tried Array("UPDATE",3, 4, 5) but got an error


Public Sub createupdatelist()
Dim v As Variant, col As Long
v = Array(3, 4, 5) ' D, E, F
col = 2
Set rng = Range(Cells(2, 1), Cells(Rows.Count, 1).End(xlUp))
For i = LBound(v) To UBound(v)
rng.Offset(, v(i)).Copy Destination:= _
Worksheets("UpdateListing").Cells(2, col)

col = col + 1
Next
End Sub


Thanks
Steve
 
J

Jacob Skaria

Use the below for clearing a range and updating cells

Range("A1:B10").Clear
Range("A1:B10") = "Update"

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top