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
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
How to install your new code![]()
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
- Copy the Excel VBA code
- Select the workbook in which you want to store the Excel VBA code
- Press Alt+F11 to open the Visual Basic Editor
- Choose Insert > Module
- Edit > Paste the macro into the module that appeared
- Close the VBEditor
- Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)
To run the Excel VBA code:
- Press Alt-F8 to open the macro list
- Select a macro in the list
- 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
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
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?
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks