Select Coloumn Range based on cell value

K

K

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
 
J

Jim Thomlinson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top