Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default join sheet 2 below sheet 1

do we have a small visual basic command with the help of which we ca
copy the used range in sheet2 and paste it below used range in sheet1

i have that big macro but i want to have simpler way

anyone can help?
thanks a lot frnd

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default join sheet 2 below sheet 1

Sub Append ()
Dim rwct
Sheet1.Activate
rwct = ActiveSheet.UsedRange.Rows.Count
Sheet2.Activate
ActiveSheet.UsedRange.Select
Selection.Copy Destination:=Sheet1.Range("A" & rwct + 1)
End Sub

Mike F
"vikram " wrote in message
...
do we have a small visual basic command with the help of which we can
copy the used range in sheet2 and paste it below used range in sheet1

i have that big macro but i want to have simpler way

anyone can help?
thanks a lot frnds


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default join sheet 2 below sheet 1

not working frnd.

shows subscript out of rang

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default join sheet 2 below sheet 1

On which line does the error occur?
"vikram " wrote in message
...
not working frnd.

shows subscript out of range


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default join sheet 2 below sheet 1

Sub Tester2()
Dim rng As Range
Set rng = Worksheets("Sheet1").UsedRange
Worksheets("Sheet2").UsedRange.Copy _
rng.Rows(rng.Rows.Count + 1).Cells.Resize(1, 1)
End Sub

Assumes your sheets are named Sheet1 and Sheet2
--
Regards,
Tom Ogilvy


"vikram " wrote in message
...
not working frnd.

shows subscript out of range


---
Message posted from http://www.ExcelForum.com/





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default join sheet 2 below sheet 1

Dim vikram
Sheets("Sheet1").Activate
vikram = ActiveSheet.UsedRange.Rows.Count
Sheets("sheet2").Activate
ActiveSheet.UsedRange.Select
Selection.Copy Destination:=Sheet1.range("A" & vikram + 1)
End Sub

error occurs in "Selection.Copy Destination:=Sheet1.range("A" & vikra
+ 1)"

it says copy area and paste area are not same size

i have range from "a:z" in sheet 2 and the same range inn sheet

--
Message posted from http://www.ExcelForum.com

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default join sheet 2 below sheet 1

thanks a lot tom it is working

thanks to u also mike...u guys are grea

--
Message posted from http://www.ExcelForum.com

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default join sheet 2 below sheet 1

Try this pal

Sheets("Sheet1").Select
Range("A1").Select
ActiveCell.SpecialCells(xlLastCell).Select
x = ActiveCell.Row
ActiveSheet.Cells(x + 1, 1).Select
x = ActiveCell.Address

Sheets("Sheet2").Select
Range("A1").Select
ActiveCell.SpecialCells(xlLastCell).Select
p = ActiveCell.Address

a = "a1"
Range(a, p).Select
Selection.Copy _
Destination:=Worksheets("sheet1").Range(x)

Good Luck
Ross
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
excel sheet bootom half sheet goes behind top part of sheet rob Excel Worksheet Functions 2 January 17th 09 01:28 AM
Duplicate sheet, autonumber sheet, record data on another sheet des-sa[_2_] Excel Worksheet Functions 0 May 8th 08 06:56 PM
How do I select price from sheet.b where sheet.a part no = sheet.b Sonny Excel Worksheet Functions 4 April 4th 06 05:08 PM
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. RonMc5 Excel Discussion (Misc queries) 9 February 3rd 05 12:51 AM
Inserting a row in sheet A should Insert a row in sheet B, removing a row in Sheet A should remove the corresponding row in sheet B Hannes Heckner Excel Programming 1 March 5th 04 09:10 AM


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