Some beginner questions about a macro I'm doing
Posted by Rohan Rangaraj on June 21, 2000 12:29 PM
Howdy folks,
This is one of the greatest, most informative sites I have ever come across, and I'd like the owners to know I appreciate the work you've put into this. I was searching and searching through the site in order to get an answer to my question, but since I have relatively zero programming skills, I haven't been able to combine different codes together to get my macro to work.
The macro is so that we can load a new data set into excel on a daily basis and evaluate our performance, so the size of the data varies.
In any event, the first thing that I wanted to do was to delete certain rows from the data set (all rows beginning with the word "Accrued interest"). So I began recording the macro, placed the cursor in cell A1, went to Edit > Find, typed "accrued interest," and clicked Find Next. Once it made the find, I went to Edit > Delete... > Entire Row, and clicked OK. Then I stopped recording the macro. On its own, when I ran the macro again it worked fine. However, I wanted to loop it, so I went with what MrExcel said in an earlier "Ask MrExcel", and entered the following line as the first line of code:
Do Until ActiveCell.Value = ""
And then I entered the line:
Loop
Just before the final line (End Sub).
When I tried to run this as a loop, it finished the whole process but afterwards gave me the following message:
"Run-time error '91'
Object variable or With block variable not set."
How do I fix that? I know I could just click in column A, sort by name, select all the rows that have Accrued interest and then delete them, but I'd rather enter that into the macro so that someone doesn't have to do that separately every morning.
One other question I have regards copying and pasting a formula all the way down a column. What I want the macro to do is to