View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nigel Nigel is offline
external usenet poster
 
Posts: 923
Default selecting a cell - really need help

The copy / paste method requires the target area to be the same size as the
source. So assign the source to a variable and directly place this in the
offset column ........

Dim x As Variant
x = ActiveCell.Value
ActiveCell.Offset(0, 5) = x


--
Cheers
Nigel



"JasonK" wrote in message
...
TIA boys and girls. i've been working on this one in other newsgroups
for quite a while and i just can't seem to make a macro work for me.

i have cells on the left side of a spreadsheet that have different
numerical data in them.

i have blank merged cells on the right side of a spreadsheet.

i have a working macro that will determine a number (a variable),
assign that number to a variable (x), then search for that number in
the numerical cells on the left side of the spread sheet, possibly
finding them anywhere.

i can select the cell with the number in it, and copy it to the
clipboard using a macro. but........... i can't paste the value of the
cell, or the value of the variable (the same value) to a cell on the
right because the cells on the right are merged cells and i get the
error, "cannot change part of a merged cell." the new cell (on the
right) will not be in a particular place so that i can reference it by
range, but will be in a position relative to the cell on the left
where the number was found. I can physically cut and paste myself
with out the macro, but when i record that, the macro recording
reference is to a specific cell that i can see is the correct one.

i tried using offset, but the error msg shows here too.

i need to be able to select and activate a cell 5 cells to the right
of some other cell, the left cell being random so that i can not call
it by address. if i can activate the destination cell, i can figure
out how to paste the number (similar to a keyboard cut and paste) and
the new cell should take the variable or the value from the preceeding
cell. activecell.value = x or something like that. i have to figure
how to make the cell 5 cells over the active cell.

i just can't make it select the destination cell. can anyone tell me
how to do this?


i hope this is clear,
thanks
jasonk