ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   To return the column number of a string (https://www.excelbanter.com/excel-worksheet-functions/148383-return-column-number-string.html)

[email protected]

To return the column number of a string
 
Hello All,
I am pretty new to Excel Macros. I was writing a code and stuck up
with this problem.
I want to write the code to return the column number of a particular
string.
Like, I have "VET" string in one of the cells, A20

My code has to return to the column number 1 for the string "VET"

Please help,
Thanks,
Prasanna.


Mike H

To return the column number of a string
 
Once you have established your string is in A20 then you return the column
number of the cell:-

x = Range("A20").Column

Mike

" wrote:

Hello All,
I am pretty new to Excel Macros. I was writing a code and stuck up
with this problem.
I want to write the code to return the column number of a particular
string.
Like, I have "VET" string in one of the cells, A20

My code has to return to the column number 1 for the string "VET"

Please help,
Thanks,
Prasanna.




All times are GMT +1. The time now is 10:50 PM.

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