How to find last row in import

F

Fred Butterfield

I import a data file. There can be as few as 3 lines or as
many as several thousand. I am formatting the import to be
a report. Here is my difficulty:

I need to insert the text "TOTAL" in column H in the
second blank row beneath the last entry. I need to insert
the formula "=sum(j4:j[whatever])" in column J in the same
row. Sometimes imported records will create a multi-line
entry in a column other than H or J, resulting in blank
cells in column H and J.

How do I find the last row and put in the text and formula
I need? Any ideas or suggestions on where to look? Thanks.
 
P

pikus

lastrow = ActiveSheet.UsedRange.Row - 1 + _
ActiveSheet.UsedRange.Rows.Count

This will give you the last used row. You need help filling in th
text/formulas too or no? - Piku
 

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