Hello, folks. I am a lurker who has picked up most of what I have learned about VBA from forums such as these. In other words, you may talk over my head.
I am working in Excel 2007. This file has a data connection set up to import a text file and perform various functions such as filtering for certain department numbers and deleting those rows and filtering for other department numbers and replacing a number in an adjacent cell. My filter and delete section works fine.
The problem is after I filter for certain department numbers (in column K) and need to replace the value in the cell next to the dept. number (column J) with a different value. I filter, then copy the new value. I can't figure out how to make my range to paste into vary with the data imported from the text file each month as this can be any number of rows. Here is my code:
The problem is the
as it may truly only be 175 rows this month or 207 rows next month. Selecting visible cells isn't helping because if my data is only 175 rows, the filter only works for the 175 rows but leaves rows 176- 300 showing.
Thanks. I will be happy to provide more info if necessary.