ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get column count used range from S to IV (https://www.excelbanter.com/excel-programming/395713-get-column-count-used-range-s-iv.html)

XP

Get column count used range from S to IV
 
Using Office 2003 and Windows XP:

I need to return a count of the used columns beginning from, and including
column "S" to column "IV"

For example, if "S" and "T" and "U" were within the used range then the
count would be 3.

Again, if "S" and "U" and "W" were within the used range, then the count
would be 5.

Hopefully this makes some sense; if not, please let me know and I will try
to clarify.

Thanks for your assistance.

joel

Get column count used range from S to IV
 
Not sure if this is what you need

Sub test3()

Set myrange = Range("S5:iv8")
MsgBox (myrange.Columns.Count)
End Sub


"XP" wrote:

Using Office 2003 and Windows XP:

I need to return a count of the used columns beginning from, and including
column "S" to column "IV"

For example, if "S" and "T" and "U" were within the used range then the
count would be 3.

Again, if "S" and "U" and "W" were within the used range, then the count
would be 5.

Hopefully this makes some sense; if not, please let me know and I will try
to clarify.

Thanks for your assistance.



All times are GMT +1. The time now is 06:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com