View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
ManhattanRebel ManhattanRebel is offline
external usenet poster
 
Posts: 85
Default Create Named Ranges (Headers) - then using range name in formu

Thank you, Dick.

I think that will work fine, but I am getting a compile error "Expected:
list separator or )" The only thing I am doing different is that my range
name is not just one word. It is actually "Red One". It has a space in it.
I don't know if that messes up anything, but I suspect not.

Am I missing a ) or : somewhere?
Thx again.

"Dick Kusleika" wrote:

On Fri, 1 Aug 2008 10:47:00 -0700, ManhattanRebel
wrote:


In a macro, I am selecting ten columns and creating range names based on the
top row.

Then I cut cells from another column and paste it to the appropriate column
by range name.

For example, I find the word "red" in cell D95. I want to paste that word,
and the cell next to it, in the column with the range name "red" in the same
row, 95. (I just want to move it over so it's in the column with the same
name.)

If I use the following code, I get an error:
Range(Cells(i, "CC"), Cells(i, "CD")).Cut Destination:=Cells(i, "Red")

Is there a way for me to specify that "Red" is only the column part of the
cell address?


Cells(i, "CC").Resize(,2).Cut Destination:=Intersect(Rows(i),
Range("Red").EntireColumn)
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com