Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default If Cell = X, Then Copy Entire Row Into A New Sheet

Hi, I am very new to excel. I really need some help writing a macro or
formula. Basically, I have a spreadsheet that is a list of events.

I need a macro or formula that says If row C = ADOTG , Then Copy Entire
Row Into A New Sheet. (ADOTG is the name of the event). Can anyone help
this excel beginner?
Thanks Mandy



*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default If Cell = X, Then Copy Entire Row Into A New Sheet

Usually, I find it much, much better to keep all the data in one
location/worksheet.

Then I can use data|filter|autofilter to show the values I want. Or I can sort
the data or create charts or pivottables.

But one way to do this is to apply data|filter|autofilter, show the rows with
ADOTG and then copy the visible cells to a new worksheet.

If you really want a macro, you could record one when you do it manually.

====
But if you have other values in that column and want to separate them into
different sheets...

You may want to look at how Ron de Bruin and Debra Dalgleish approached this
kind of thing:

Ron de Bruin's EasyFilter addin:
http://www.rondebruin.nl/easyfilter.htm

Or:

Code from Debra Dalgleish's site:
http://www.contextures.com/excelfiles.html

Create New Sheets from Filtered List -- uses an Advanced Filter to create
separate sheet of orders for each sales rep visible in a filtered list; macro
automates the filter. AdvFilterRepFiltered.xls 35 kb

Update Sheets from Master -- uses an Advanced Filter to send data from
Master sheet to individual worksheets -- replaces old data with current.
AdvFilterCity.xls 55 kb



Mandy wrote:

Hi, I am very new to excel. I really need some help writing a macro or
formula. Basically, I have a spreadsheet that is a list of events.

I need a macro or formula that says If row C = ADOTG , Then Copy Entire
Row Into A New Sheet. (ADOTG is the name of the event). Can anyone help
this excel beginner?
Thanks Mandy

*** Sent via Developersdex http://www.developersdex.com ***


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default If Cell = X, Then Copy Entire Row Into A New Sheet

SORRY my request should be COLUMN C - not row c.
Thanks
Mandy

I need a macro or formula that says If COLUMN C = ADOTG , Then Copy
Entire
Row Into A New Sheet. (ADOTG is the name of the event). Can anyone help
this excel beginner?
Thanks Mandy

*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default If Cell = X, Then Copy Entire Row Into A New Sheet

Name one sheet 'CopyFrom' and name another sheet 'CopyTo'.
Run code...........

Sub Copyx()
Dim RngColF As Range
Dim i As Range
Dim Dest As Range
Sheets("CopyFrom").Select
Set RngColF = Range("C1", Range("C" & Rows.Count).End(xlUp))
With Sheets("CopyTo")
Set Dest = .Range("A1")
End With
For Each i In RngColF
If i.Value = "x" Then
i.EntireRow.Copy Dest
Set Dest = Dest.Offset(1)
End If
Next i
End Sub

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Mandy" wrote:

SORRY my request should be COLUMN C - not row c.
Thanks
Mandy

I need a macro or formula that says If COLUMN C = ADOTG , Then Copy
Entire
Row Into A New Sheet. (ADOTG is the name of the event). Can anyone help
this excel beginner?
Thanks Mandy

*** Sent via Developersdex http://www.developersdex.com ***

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default If Cell = X, Then Copy Entire Row Into A New Sheet

On Sep 26, 9:56*pm, ryguy7272
wrote:
Name one sheet 'CopyFrom' and name another sheet 'CopyTo'. *
Run code...........

Sub Copyx()
Dim RngColF As Range
Dim i As Range
Dim Dest As Range
Sheets("CopyFrom").Select
Set RngColF = Range("C1", Range("C" & Rows.Count).End(xlUp))
With Sheets("CopyTo")
Set Dest = .Range("A1")
End With
For Each i In RngColF
If i.Value = "x" Then
i.EntireRow.Copy Dest
Set Dest = Dest.Offset(1)
End If
Next i
End Sub

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''..

"Mandy" wrote:
SORRY my request should be COLUMN C - not row c.
Thanks
Mandy


I need a macro or formula that says If COLUMN C = ADOTG , Then Copy
Entire
Row Into A New Sheet. (ADOTG is the name of the event). Can anyone help
this excel beginner?
Thanks Mandy


*** Sent via Developersdexhttp://www.developersdex.com***


Thank you Ryan - this was very helpful!
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
copy entire rows to another sheet amjad_bang Excel Worksheet Functions 2 July 18th 10 08:02 PM
Help: auto-copy entire rows from 1 sheet (based on cell criteria) to another sheet. bertbarndoor Excel Programming 4 October 5th 07 04:00 PM
Copy an entire sheet Gynandra Excel Discussion (Misc queries) 1 June 28th 06 04:31 AM
Copy Entire Sheet Linda Excel Discussion (Misc queries) 1 June 11th 06 11:04 PM
Copy the entire sheet to overlay existing sheet? LurfysMa New Users to Excel 2 August 29th 05 07:05 PM


All times are GMT +1. The time now is 01:15 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"