Hello excelforum, I am new here and with creating macros.
As of now I am trying to wrap my brain about counting the amount of columns with data in a worksheet. I see for example UsedRange.Columms.Count is a way but I cannot figure out how to use with a custom range. What I basically want to do is count how many columns in the range of C9:E23 have any value in it. (e.g. if there's any value in C, D and E in the range C9:E23, it returns 3). But any attempt of combining it with Range("C9:E23") returns errors.
On recommendation of someone else I also tried Range("C9:E23").SpecialCells(xlTextValues + xlNumbers).Columns.Count but this returns a 1004 Application defined or object defined error.
Am I looking in the wrong spot? Any help is deeply appreciated.
Bookmarks