\r\n\r\n
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


\r\n \r\n
 
 
Thread Tools Display Modes

\r\n\r\n\r\n
hi,
\r\n
\r\ni searched for a string which is find in a cell which is merged.
\r\nnow 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.
\r\nhere a little example :
\r\n| -' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '- string -' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '- |
\r\n| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
\r\n
\r\nthat\'s my code :
\r\n
\r\n fleetpos.Offset(4, 6).Select
\r\n Do While Not fleetpos.Value = Empty
\r\n If fleetpos.Value = actualplanetname Then
\r\n ActiveCell.Offset(0, 17).Value = ActiveCell.Offset(0, 17).Value + fleetpos.Offset(0, 1).Value
\r\n End If
\r\n fleetpos.Offset(1, 0).Select
\r\n Loop
\r\n
\r\nbefore and after "fleetpos.Offset(1, 0).Select" fleetpos has the same address. i think i have a general problem.
\r\nplease help a newbie in VBA.
\r\n
\r\nps: if someone knows a solve for the addition with more elegance post it too
\r\n \r\n\r\n
\r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n Reply With Quote\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n'; pd[285038] = '\r\n\r\n \r\n\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n \r\n
\r\n
\r\n  \r\n #2  \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n Old\r\n \r\n 01-12-2003, 03:22 AM\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
Timbo\'s Avatar\r\n\r\n
\r\n \r\n Timbo\r\n Timbo is offline\r\n\r\n\r\n
Prev Previous Post   Next Post Next
  #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
 


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
 
 
-->