View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default Help with simple(?) macro

Hi

You should be able to do this with the Resize medthod already provided (it's
not obvious, no critisism intended):

Set R = Selection(1)
R.Resize(Sheets(1).Range("Field").Rows.Count, _
Sheets(1).Range("Field").Columns.Count).Value = _
Sheets(1).Range("Field").Value

HTH. Best wishes Harald

"Cutter " skrev i melding
...
Thanks again for your reply Harald. The macro as I posted works fine
except for the line:

R.Value = Sheets(1).Range("Field").Value

This line puts the value of the first cell of "Field" in my active
cell. But "Field" is a row of 18 adjacent cells. What I want is a way
to paste the values of the 18 cells in "Field" to my active sheet so
that my active sheet has a row of 18 adjacent cells with each cell
showing the value of the corresponding 18 cells from the sheet where
"Field" exists.