PDA

View Full Version : VBA error



Owl
07-07-2022, 03:30 AM
Hello!
I would like to seek your help in this issue below.

Every month, I have a list of invoice numbers which my colleagues save into folder.
For some months, they might save the invoice numbers in a range.
For other months, they might save individual invoice number.

As for certain months the invoice numbers are saved in a range, I have my macro to insert blank rows and auto fill the blank rows.
(Eg. INVOICE1-20 <- this could be the file name, my macro will insert blank rows and auto fill and it looks like INVOICE1, INVOICE2... etc)
My macro works if the invoice numbers are saved in a range.

However, my macro encounter errors when the list of invoices for that month ain't save in a range.

I tried to debug and continue to run, but keep prompting me the same issue as there is nothing for the macro to fill any blanks. there are no blanks at all.
The error is in the attachment.

How can I get my macro to ignore the command to fill blanks, if there are no blanks to fill?

29914

Paul_Hossler
07-07-2022, 10:07 AM
On Error Resume Next

Columns .......

On Error Goto 0

georgiboy
07-07-2022, 12:26 PM
Might be worth restricting the entire column to the used range within the column, I am sure you will not need every blank cell in the column filled with formulae.