1. why not selecting cells? performance slowdown?
Yes. That and also you can't select a range unless it is on the active sheet, so you have to select the sheet too. There are some situations where you have to select cells, but this isn't one of them.
2. you starting from the last row upwards to see if there is content, if no then skip, if yes write formula. However, are you really starting at the last row? I dont see you see you determine cell content from A65536 upwards... how do you know where is the last row?
I determine it on this line here:
ws.Rows.Count will return the number of rows on the worksheet. For you, this will be 65536. I explicitly convert the number into a string "65536" using CStr() and then concatenate it with "A" to give me "A65536". I then use the Range.End(xlUp) method (since I based the approach on the code you provided) to get the last row in column A with data in.
3. what exactly is "Cstr" doing? Cell String?
See my answer to (2) and also have a look at the "Type Conversion Functions" topic in your VBA helpfile. If you google for implicit and explicit data type conversions you will find plenty of material on the subject.
Bookmarks