Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / February 2008

Tip: Looking for answers? Try searching our database.

Visual Basic code for macros

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Derek Peters - 31 Jan 2008 23:08 GMT
I'm trying to write a macro to transfer new data from one sheet in a workbook
to another. To do it I need to navigate from the active cell to others by
using the active cell as a reference point and moving by "R[+n]C[-x]" rather
than by a specific cell address (eg H4) referenced from the top left corner.
Is there a way I can get a useable return from the ActiveCell function, or
any other code structure that might give me the result I'm looking for?
I'm using Excel 2002 and Visual Basic Version 6.3.
Thank you.
Dave Peterson - 01 Feb 2008 00:30 GMT
maybe you could use

   activecell.offset(n,-x)

> I'm trying to write a macro to transfer new data from one sheet in a workbook
> to another. To do it I need to navigate from the active cell to others by
[quoted text clipped - 4 lines]
> I'm using Excel 2002 and Visual Basic Version 6.3.
> Thank you.

Signature

Dave Peterson

Derek Peters - 01 Feb 2008 19:02 GMT
Thank you for the suggestion Dave, it certainly looks like it ought to work
but I get either a Syntax Error or a Compile Error all the time, even when I
use the syntax that suggested in Help.

> maybe you could use
>
[quoted text clipped - 8 lines]
> > I'm using Excel 2002 and Visual Basic Version 6.3.
> > Thank you.
Jim Rech - 01 Feb 2008 19:10 GMT
Example: To move to the cell 3 rows down and 2 columns right this is the
syntax to use:

ActiveCell.Offset(3, 2).Select

Signature

Jim

| Thank you for the suggestion Dave, it certainly looks like it ought to work
| but I get either a Syntax Error or a Compile Error all the time, even when I
[quoted text clipped - 12 lines]
| > > I'm using Excel 2002 and Visual Basic Version 6.3.
| > > Thank you.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.