Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Word, PowerPoint, Outlook, and Other Office Products > Problem with Offset


Reply
 
Thread Tools Display Modes
  #1  
Old 01-12-2003, 12:29 AM
hardy
Guest
 
Posts: n/a
Default Problem with Offset


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
Reply With Quote
  #2  
Old 01-12-2003, 03:22 AM
Timbo's Avatar
Timbo Timbo is offline
Green-Eyed

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Bangkok, Thailand
Posts: 10,261
Default

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.
__________________
"He's not the Messiah. He's a very naughty boy!" - Brian's mum

Can't find the answer? >> Try something new!
Become a Professional
Reply With Quote
  #3  
Old 01-12-2003, 07:59 AM
hardy
Guest
 
Posts: n/a
Default

yes, that's help.

Last edited by hardy; 01-12-2003 at 08:21 AM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->