LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Selecting sheet 2

I have a Sub that grabs data from sheet1 and i cant get it to grab the data
(in column K) from sheet2, even when i add Worksheet("Sheet2") as shown
below...?

How can I use this macro to grab the data from sheet2, not sheet1?

Sub ReLargeMoves()
Dim c As Range, rng As Range, lngRow As Long
Set rng = Worksheets("Sheet2").Range("K2:K" & Cells(Cells.Rows.Count,
"K").End(xlUp).Row)
For Each c In rng
If WorksheetFunction.Large(rng, 1) = c.Value Or _
WorksheetFunction.Large(rng, 2) = c.Value Or _
WorksheetFunction.Large(rng, 3) = c.Value Or _
WorksheetFunction.Small(rng, 1) = c.Value Or _
WorksheetFunction.Small(rng, 2) = c.Value Or _
WorksheetFunction.Small(rng, 3) = c.Value Then _
lngRow = lngRow + 1: Rows(c.Row).Copy
Sheets("Sheet3").Range("A15").Rows(lngRow)
Next
End Sub
 
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
Selecting sheet with VB RobN[_2_] Excel Discussion (Misc queries) 14 May 23rd 08 01:36 AM
selecting sheet name in another workbook by variable (same sheet name) Craig[_24_] Excel Programming 1 April 25th 06 05:45 PM
Print a sheet without ever selecting the sheet sharkfoot Excel Programming 3 March 15th 06 02:06 AM
Selecting Last Sheet Bonbon Excel Worksheet Functions 17 February 22nd 06 04:16 PM
Selecting sheet Fernando Gomez Excel Programming 0 September 2nd 04 03:50 PM


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