Problem with Offset

hardy
01-12-2003, 12:29 AM
hi,

i searched for a string which is find in a cell which is merged.
now i want the a value in a relativ position from there 4 rows down and in the range of the merged cell. but i can only find the first column not the 7th for example.
here a little example :
| ---------- string ------------ |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |

that's my code :

fleetpos.Offset(4, 6).Select
Do While Not fleetpos.Value = Empty
If fleetpos.Value = actualplanetname Then
ActiveCell.Offset(0, 17).Value = ActiveCell.Offset(0, 17).Value + fleetpos.Offset(0, 1).Value
End If
fleetpos.Offset(1, 0).Select
Loop

before and after "fleetpos.Offset(1, 0).Select" fleetpos has the same address. i think i have a general problem.
please help a newbie in VBA.

ps: if someone knows a solve for the addition with more elegance post it too :)

Timbo
01-12-2003, 03:22 AM
I'm sure I remember that a merged cell range can only be manipulated as 1 cell, ie it only has 1 column.
Unmerge the cells and use the 'Center accross selection' option in the text alignment drop-down on the Excel format menu.

hardy
01-12-2003, 07:59 AM
yes, that's help.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum