Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default Macro to find range of cells

I'm new to Excel macros and need to copy the entire rows for the range from
the first through the last occurrence of "vacation" in column A. The number
of rows will vary each month. Then I need to paste those rows onto Sheet1 in
cell A1.

I've tried using the macro recorder but not getting anywhere. Can you help?

Thanks, Mary
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default Macro to find range of cells

Please tell us in more detail how the layout of the data
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Mary" wrote in message
...
I'm new to Excel macros and need to copy the entire rows for the range
from
the first through the last occurrence of "vacation" in column A. The
number
of rows will vary each month. Then I need to paste those rows onto Sheet1
in
cell A1.

I've tried using the macro recorder but not getting anywhere. Can you
help?

Thanks, Mary



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default Macro to find range of cells

There are several columns of data separated by function. I want to find and
copy only the rows that have "vacation" in column A to a new worksheet. I
have a macro that sorts the workbook, so all rows are together. The first
and last row for the rows that have the vacation information will vary each
month when the report comes out.

"Bernard Liengme" wrote:

Please tell us in more detail how the layout of the data
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Mary" wrote in message
...
I'm new to Excel macros and need to copy the entire rows for the range
from
the first through the last occurrence of "vacation" in column A. The
number
of rows will vary each month. Then I need to paste those rows onto Sheet1
in
cell A1.

I've tried using the macro recorder but not getting anywhere. Can you
help?

Thanks, Mary




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default Macro to find range of cells

Thanks, that helped. I didn't see all of the options you mentioned in Office
2007, but was able to use autofilter in the macro recorder and it works great.

Here's my code:

Sub vac_filter()
Selection.AutoFilter
ActiveSheet.Range("$A$1:$P$65536").AutoFilter Field:=1,
Criteria1:="vacation"
Cells.Select
Sheets("Exec Dir Details").Select
Sheets("Exec Dir Details").Copy After:=Sheets(3)
Range("A1").Select
End Sub

"Don Guillett" wrote:


Have a look at
datafilterautofilterfilter copy/paste. Record
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Mary" wrote in message
...
I'm new to Excel macros and need to copy the entire rows for the range
from
the first through the last occurrence of "vacation" in column A. The
number
of rows will vary each month. Then I need to paste those rows onto Sheet1
in
cell A1.

I've tried using the macro recorder but not getting anywhere. Can you
help?

Thanks, Mary



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
Find used range and ignore blank cells when running macro? Rick S. Excel Programming 3 October 3rd 07 02:52 PM
macro to find and change text within a range of cells... schwammrs Excel Programming 3 May 21st 07 11:36 PM
Find range of merged cells mcphc Excel Programming 2 February 1st 07 09:37 AM
Find a range of values in a range of cells Jack Taylor Excel Worksheet Functions 20 November 25th 06 01:26 PM
find a cells from a range of cell kelvintaycc Excel Worksheet Functions 2 April 2nd 05 07:20 PM


All times are GMT +1. The time now is 11:44 PM.

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"