In a sheet i have these columns
A B C D E
41667228 xxxxxx 5654645 51555567 dsfsdfsd
41667223 vvvvvv 8888889 fdsfsdf sdfsdf
41667232 45672828 7777777 sdfdsfs 45435435
41667225 89999999 7656546 21432423 45435435
I am writing a VBA macro so that it finds out the column where the user is inputing the invoice no. an invoice no is 8 digit number and always starts with a 4. in the above, the invoice number is in column A but the data entry can be random. sometimes the user puts it in column D. sometimes in in E. sometimes the column header starts on row 8. also there can be more columns.
any idea how to approach this?
should i loop in each column? but how to determine which column has the invoice number? I need to make sure that all rows in that column contains a number which start with a 4 and is of 8 digit length.
any advice?
A B C D E
41667228 xxxxxx 5654645 51555567 dsfsdfsd
41667223 vvvvvv 8888889 fdsfsdf sdfsdf
41667232 45672828 7777777 sdfdsfs 45435435
41667225 89999999 7656546 21432423 45435435
I am writing a VBA macro so that it finds out the column where the user is inputing the invoice no. an invoice no is 8 digit number and always starts with a 4. in the above, the invoice number is in column A but the data entry can be random. sometimes the user puts it in column D. sometimes in in E. sometimes the column header starts on row 8. also there can be more columns.
any idea how to approach this?
should i loop in each column? but how to determine which column has the invoice number? I need to make sure that all rows in that column contains a number which start with a 4 and is of 8 digit length.
any advice?
Last edited: