Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default argh, can't get it to work

Hello,

I have a problem with a excel sheet. The sheet contains 250 rows of
data. I want to extract rows that contain a specific value in a column.
e.g.

a b c d
1 / 2 3 THIS ONE
3 * 3 2
1 / 3 6 THIS ONE
3 / 9 9 THIS ONE
3 * 7 7
3 / 3 2 THIS ONE

Now the rows with a / value in column b have to be extracted and copied
into another sheet.
I hope somebody can help me.

Regards,
Niek



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default argh, can't get it to work

Sub Macro1()
Dim iRow1 As Long
Dim iRow2 As Long
Dim ws1 as Worksheet
Dim ws2 as Worksheet

Set ws1 = Worksheets("Sheet1")
Set ws2 = Worksheets("Sheet2")
For iRow1 = 1 to 250
If ws.Cells(iRow1, 2) < "/" then
iRow2 = iRow2 +1
ws1.Range("A" & iRow1 & ":D" & iRow1).Copy _
Destination:=ws2.Range("A" & iRow2 & ":D" & iRow2)
End If
Next iRow1
End Sub

HTH,
Merjet


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default argh, can't get it to work


-----Original Message-----
Hello,

I have a problem with a excel sheet. The sheet contains

250 rows of
data. I want to extract rows that contain a specific

value in a column.
e.g.

a b c d
1 / 2 3 THIS ONE
3 * 3 2
1 / 3 6 THIS ONE
3 / 9 9 THIS ONE
3 * 7 7
3 / 3 2 THIS ONE

Now the rows with a / value in column b have to be

extracted and copied
into another sheet.
I hope somebody can help me.

Regards,
Niek



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from

http://www.ExcelForum.com/


This code should work as long as the sheet with the
data in it is the active sheet.
Substitute "sheet2" on line 8 with the target sheet name.

Columns("B:B").Select
Selection.AutoFilter
Range("A1").Select
Selection.AutoFilter Field:=1, Criteria1:="/"
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
Range("A1").Select

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default argh, can't get it to work

If the functions in the freely downloadable file at
http://home.pacbell.net/beban are available to your workbook, something
like the following will work:

arr = ArrayRowFilter1(Sheets(4).Range("A1:D6"), 2, "/")
Sheets(3).Range("A1:D" & UBound(arr)).Value = arr

Alan Beban

solo_razor wrote:
Hello,

I have a problem with a excel sheet. The sheet contains 250 rows of
data. I want to extract rows that contain a specific value in a column.
e.g.

a b c d
1 / 2 3 THIS ONE
3 * 3 2
1 / 3 6 THIS ONE
3 / 9 9 THIS ONE
3 * 7 7
3 / 3 2 THIS ONE

Now the rows with a / value in column b have to be extracted and copied
into another sheet.
I hope somebody can help me.

Regards,
Niek



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default argh, can't get it to work

You could also try just doing a filter and copy paste like this one

Selection.AutoFilter Field:=2, Criteria1:="=*/*", Operator:=xlAnd
Columns("A:A").Copy
Sheets("Medarbejderdata").Select
Cells.Select
ActiveSheet.Paste



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

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
how can i automatically generate work order numbers from work orde rob h Excel Discussion (Misc queries) 1 July 13th 09 07:59 PM
flash object dont work in my excel work sheet Nitn Excel Discussion (Misc queries) 0 July 4th 09 08:00 AM
SUMPRODUCT problems...argh... Cita Excel Discussion (Misc queries) 10 September 23rd 08 09:20 PM
formula I can't figure it out?! ARGH jewels Excel Worksheet Functions 4 December 8th 05 01:04 PM
Is there away to keep "auto save" from jumping to the first work sheet in the work book? Marc New Users to Excel 2 April 21st 05 01:27 AM


All times are GMT +1. The time now is 07:42 PM.

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"