ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select Coloumn Range based on cell value (https://www.excelbanter.com/excel-programming/417071-select-coloumn-range-based-cell-value.html)

K[_2_]

Select Coloumn Range based on cell value
 
I want macro that when I put any word from "A" to "Z" in Range("A1")
it should select that coloumn range from row 1 to down. For example
if I put "H" in Range("A1") and by pressing button macro should select
coloumn "H" range from row 1 to down. Please can any one help.
Thanks

Jim Thomlinson

Select Coloumn Range based on cell value
 
Here is some code that you can attach to your button...

Sub Test
dim rng as range

on error resume next
set rng = range(cells(1, Range("A1").value), _
cells(rows.count, range("A1").value).end(xlup))
on error goto 0

if not rng is nothing then rng.select
end sub

--
HTH...

Jim Thomlinson


"K" wrote:

I want macro that when I put any word from "A" to "Z" in Range("A1")
it should select that coloumn range from row 1 to down. For example
if I put "H" in Range("A1") and by pressing button macro should select
coloumn "H" range from row 1 to down. Please can any one help.
Thanks



All times are GMT +1. The time now is 07:57 AM.

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