Results 1 to 6 of 6

Feeling good but...help with last row

Threaded View

Thunderer Feeling good but...help with... 01-29-2014, 10:33 AM
alansidman Re: Feeling good but...help... 01-29-2014, 10:50 AM
alansidman Re: Feeling good but...help... 01-29-2014, 10:53 AM
TMS Re: Feeling good but...help... 01-29-2014, 12:01 PM
Thunderer Re: Feeling good but...help... 01-29-2014, 01:24 PM
TMS Re: Feeling good but...help... 01-29-2014, 02:08 PM
  1. #1
    Registered User
    Join Date
    12-13-2013
    Location
    Stephens City, VA
    MS-Off Ver
    Excel 2010
    Posts
    24

    Feeling good but...help with last row

    So I've finally been able (after several days of searching) to come up with and modify VBA code that will look for "Y" in column Q of three worksheets and copy the entire row to another worksheet ("!!").

    My problem is with z = 3000

    I'm trying to reduce the amount of processing it takes to find the data I want and make this code the simplest I can.

    I've looked and tried several examples but can not get a last row search, instead of specifying the last row as 3000. Eventually I will have to search more than 3000 rows for the information I want.

    Any help is appreciated.

    My code:

    Sub Test()
       Dim i as Integer
       Dim j as Integer
       Dim cal (1 to 3) As String
           cal (1) =  "Incident Data"
           cal (2) = "Change Data"
           cal (3) =  "Task Data"
    
       Dim x as Integer
       Dim y as Integer
       Dim z as Integer
    
    y = 17
    z = 3000
    
    j = 2
    
    For x = 1 to 3
    For i = 2 to z
    
       If Sheets(cal(x)).Cells(i,y) = "Y" Then
            Sheets(cal(x)).Select
            Range (Sheets(cal(x)).Cells(i.1), Sheets(cal(x)).Cells(i,17)).Select
            Selection.Copy
            Application.Goto ActiveWorkbook.Sheets("!!").Cells(j,1)
            ActiveSheet.Paste
    Else
        j = j -1
        End If
        j = j +1
    Next i
    Next x
    
    End Sub
    Last edited by alansidman; 01-29-2014 at 10:50 AM. Reason: code tags added

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Hi, I am feeling great about join this forum
    By Hardup in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 01-25-2013, 11:32 AM
  2. Hi, Feeling good to be in this Forum
    By AsifSayed in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 10-14-2012, 07:07 PM
  3. Feeling Stupid
    By burkhamerk in forum Excel General
    Replies: 2
    Last Post: 07-09-2011, 02:40 AM
  4. Anyone feeling brainy?
    By dominicb in forum The Water Cooler
    Replies: 22
    Last Post: 01-25-2009, 01:28 PM
  5. Feeling Scattered about XY Scatter Chart
    By ExcelJamie in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 12-02-2006, 06:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1