Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Select specific # of rows below selected cell - please help

I have about 500 identical forms people fill out, all on a single
worksheet. They occupy Columns A, B C and D. They are arranged
vertically. Each form is 73 rows long, with a couple of blank lines
between each one.

The data we need is in Column D.

The staff will identify certain forms. On each identified form, Copy
the data in Column D, and do a Paste Special/Transpose onto another
worksheet in another workbook.

I'm trying to fix a macro that lets them just select the first data
cell in Column D on the form, then they execute the macro and it
automatically selects and copies the next 68 cells below it.

At first, it looks simple:
-----------------------
Sub copydata()
'
' copydata Macro
' Macro recorded 7/23/2007 by rmorgan
'
' Keyboard Shortcut: Ctrl+Shift+A
'
Range("D5:D73").Select
Selection.Copy
End Sub
------------------------

I need to be able to select ANY cell in Column D, and then the macro
selects and copies that cell and the next 68 cells below it.

The problem is, every time the macro executes, it jumps back up to Row
5 and selects/copies Cells D5 through D73.

I've done some reading on the Range method, but can't find anything
that fixes this. Can somebody please tell me how the code above could
be tweaked to do this?

Thanks,
Please reply to the newsgroup.

Ron M.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Select specific # of rows below selected cell - please help

You can use Offset

Range(ActiveCell, ActiveCell.Offset(68, 0)).Copy



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


wrote in message oups.com...
I have about 500 identical forms people fill out, all on a single
worksheet. They occupy Columns A, B C and D. They are arranged
vertically. Each form is 73 rows long, with a couple of blank lines
between each one.

The data we need is in Column D.

The staff will identify certain forms. On each identified form, Copy
the data in Column D, and do a Paste Special/Transpose onto another
worksheet in another workbook.

I'm trying to fix a macro that lets them just select the first data
cell in Column D on the form, then they execute the macro and it
automatically selects and copies the next 68 cells below it.

At first, it looks simple:
-----------------------
Sub copydata()
'
' copydata Macro
' Macro recorded 7/23/2007 by rmorgan
'
' Keyboard Shortcut: Ctrl+Shift+A
'
Range("D5:D73").Select
Selection.Copy
End Sub
------------------------

I need to be able to select ANY cell in Column D, and then the macro
selects and copies that cell and the next 68 cells below it.

The problem is, every time the macro executes, it jumps back up to Row
5 and selects/copies Cells D5 through D73.

I've done some reading on the Range method, but can't find anything
that fixes this. Can somebody please tell me how the code above could
be tweaked to do this?

Thanks,
Please reply to the newsgroup.

Ron M.

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
In VBA, How to Refer to Cell In Specific Column But Selected Rows? PBJ Excel Discussion (Misc queries) 7 August 3rd 07 05:56 PM
Macro to delete specific rows above selected cell [email protected] Excel Programming 3 August 25th 06 04:14 PM
select specific rows Paulg[_12_] Excel Programming 1 August 22nd 06 06:09 PM
select and delete specific rows Paulg Excel Discussion (Misc queries) 1 August 22nd 06 04:12 PM
select rows to print where there's data in specific column ebarbieri Excel Discussion (Misc queries) 1 July 4th 06 11:54 PM


All times are GMT +1. The time now is 08:44 AM.

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

About Us

"It's about Microsoft Excel"