Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Copy user entered Range from one sheet to another

Hi,

I have a sheet with about 48 rows and columns with data from Row A to
Row CD. When The macro runs I want to create a new sheet and copy the
first 5 rows to the new sheet and give the user a way to choose the
other row to copy to the new sheet.

I am able to create the new sheet and to let the user select the rows
to copy, buth the new sheet is blank. Could Somebody please help.

Thx
dpatwary

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Copy user entered Range from one sheet to another

Here is the code I have written.

Sub SpreadWorkAssgmnt()
Dim RowToBeCopied As Range 'This line of code is optional

Dim wSht As Worksheet
Dim ResultWSht As Worksheet

Dim shtName As String
Dim Last As Long

Set Rng = Application.InputBox(prompt:="Select Column to Work on",
Type:=8)

Rng.Select

shtName = Format(Now, "mmmm_yyyy")
For Each wSht In Worksheets
If wSht.Name = shtName Then
MsgBox "Sheet already exists...Make necessary " & _
"corrections and try again."
Exit Sub
End If
Next wSht

Set ResultWSht = ThisWorkbook.Worksheets.Add
ResultWSht.Name = shtName
Set wSht = ActiveSheet
wSht.Range("A1").Copy
ResultWSht.Range ("A1:CD5")
MsgBox "I am at the END"
End Sub

Thanks

wrote:
Hi,

I have a sheet with about 48 rows and columns with data from Row A to
Row CD. When The macro runs I want to create a new sheet and copy the
first 5 rows to the new sheet and give the user a way to choose the
other row to copy to the new sheet.

I am able to create the new sheet and to let the user select the rows
to copy, buth the new sheet is blank. Could Somebody please help.

Thx
dpatwary


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
user input decides cell copy range beatrice25 Excel Programming 0 May 17th 06 07:28 PM
user input decides cell copy range beatrice25 Excel Discussion (Misc queries) 0 May 17th 06 06:51 PM
How do I edit a selected range then copy the range into an new sheet??? dwyborn Excel Programming 2 December 16th 05 04:11 PM
User form browsing for a range on a sheet? Don Wiss Excel Programming 3 September 22nd 04 03:02 AM
Copy from User form to Sheet macro tas5tas Excel Programming 1 January 13th 04 03:54 AM


All times are GMT +1. The time now is 05:15 AM.

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"