+ Reply to Thread
Results 1 to 5 of 5

How to extract first 50 rows

Hybrid View

chavanalini How to extract first 50 rows 12-12-2013, 08:36 AM
alansidman Re: How to extract first 50... 12-12-2013, 08:48 AM
chavanalini Re: How to extract first 50... 12-12-2013, 09:01 AM
alansidman Re: How to extract first 50... 12-12-2013, 10:08 AM
chavanalini Re: How to extract first 50... 12-13-2013, 05:07 AM
  1. #1
    Registered User
    Join Date
    03-06-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    95

    How to extract first 50 rows

    Hi,

    I want to copy and paste first 50 rows from sheet1 to sheet2

    Please help is there any formula to do this

    Thank you

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: How to extract first 50 rows

    Sub first50()
        Dim w1 As Worksheet
        Dim w2 As Worksheet
        Set w1 = Sheets("Sheet1")
        Set w2 = Sheets("Sheet2")
        Dim r As Range
        Dim lc As Long
        lc = w1.Cells(1, Columns.Count).End(xlToLeft).Column
        Set r = w1.Range(Cells(1, 1), Cells(50, lc))
            r.Copy w2.Range("A1")
            Application.CutCopyMode = False
    End Sub
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    03-06-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: How to extract first 50 rows

    Thank you for your response

    but i dont want to use VBA code please tell me is there any formula to do this exercise, sorry for taxing your time.

    Thank you

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: How to extract first 50 rows

    VBA or a manual copy and paste. The only other solution is to put formulas in sheet2

    in A1 type =Sheet1!A1 and then manually copy down fifty rows. I don't see that this is any easier than a manual copy and paste.

    For my own curiosity, why don't you want to use VBA?

  5. #5
    Registered User
    Join Date
    03-06-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: How to extract first 50 rows

    Thanks for your reply

    I dont have any problem to use VBA, but I have to give this excel file to client every time they have to press Alt-F8, I dont want to give extra work to them thats why I am asking about the formula.

    If there is no formula is there any VBA code to generate automatically when I open the excel file instead of pressing Alt - F8

    Thank you



    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. ip extract from two rows
    By alobudalo in forum Excel General
    Replies: 1
    Last Post: 03-20-2013, 08:42 AM
  2. Replies: 3
    Last Post: 01-31-2013, 04:33 AM
  3. Extract rows and resort without VB
    By martinhough in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-16-2012, 01:20 PM
  4. Data Extract from Rows
    By ng6971 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-05-2011, 10:33 PM
  5. [SOLVED] many rows for 1 ref#, need to extract 1st row only for 1 ref#
    By J LI in forum Excel General
    Replies: 1
    Last Post: 03-17-2006, 02:35 PM

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