Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving around cell by cell in VBA?


Lovely people,

I'm having trouble using VBA to move activecell.

For example, i'm using a search macro to find a keyword on m
worksheet, and then i want it to:

Activecell to go down 4 rows, and right 1 column. (ie. from A41 to B4
(but can't use cells as they will change))
Select an area 24 rows down, and 2 columns across (ie. B45:C69) an
copy it onto the clip board.

I think i could do the rest now..

Any help would be very appreciated, thank you

--
druce
-----------------------------------------------------------------------
drucey's Profile: http://www.excelforum.com/member.php...fo&userid=3255
View this thread: http://www.excelforum.com/showthread.php?threadid=53449

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Moving around cell by cell in VBA?

Given FIND ia at activecell:

Dim rng as range
Set rng = ActiveCell.Offset(4, 1).Resize(24, 2)
MsgBox rng.Address
Rng.copy .....

24 rows, 2 columns from B45 will be B45:C68 not B45:C69

HTH

"drucey" wrote:


Lovely people,

I'm having trouble using VBA to move activecell.

For example, i'm using a search macro to find a keyword on my
worksheet, and then i want it to:

Activecell to go down 4 rows, and right 1 column. (ie. from A41 to B45
(but can't use cells as they will change))
Select an area 24 rows down, and 2 columns across (ie. B45:C69) and
copy it onto the clip board.

I think i could do the rest now..

Any help would be very appreciated, thank you!


--
drucey
------------------------------------------------------------------------
drucey's Profile: http://www.excelforum.com/member.php...o&userid=32553
View this thread: http://www.excelforum.com/showthread...hreadid=534493


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving around cell by cell in VBA?


Amazing! Thank you so much


--
drucey
------------------------------------------------------------------------
drucey's Profile: http://www.excelforum.com/member.php...o&userid=32553
View this thread: http://www.excelforum.com/showthread...hreadid=534493

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving around cell by cell in VBA?


Ah, figured out the moving around bit - ActiveCell.Offset(4,1).Select
:)

i'm so pleased with myself

Now just the selecting ...


--
drucey
------------------------------------------------------------------------
drucey's Profile: http://www.excelforum.com/member.php...o&userid=32553
View this thread: http://www.excelforum.com/showthread...hreadid=534493

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Moving around cell by cell in VBA?

Glad you've worked it out (the best learning)... but avoid using SELECTS if
you can as they are inefficient!

"drucey" wrote:


Ah, figured out the moving around bit - ActiveCell.Offset(4,1).Select
:)

i'm so pleased with myself

Now just the selecting ...


--
drucey
------------------------------------------------------------------------
drucey's Profile: http://www.excelforum.com/member.php...o&userid=32553
View this thread: http://www.excelforum.com/showthread...hreadid=534493




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Arrow keys moving whole excel sprdsht insted of from cell to cell Ms-Exl-Learner New Users to Excel 2 December 17th 09 07:20 AM
Moving cell contents to new cell loses background color in old cel John Excel Discussion (Misc queries) 4 May 11th 09 01:56 AM
Arrows not moving from cell to cell, when I push arrow columns m Luanne Excel Discussion (Misc queries) 2 December 11th 08 07:24 PM
Arrow keys move screen instead of moving from cell to cell. JaJay777 Setting up and Configuration of Excel 1 January 17th 05 06:48 PM
How to copy formatting when moving from cell to variable to another cell on another worksheet kls[_2_] Excel Programming 1 September 11th 04 10:42 PM


All times are GMT +1. The time now is 04:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"