Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copying ranges etc


i am having problems getting this to work. i would like to know i
someone can solve this???
thanks alot

I will describe what it's supposed to do:
1. ask user for a Round number
2. matches that up with range of data in sheet 1 to ensure that it'
valid
3. selects a range of 13 cells in the row (on sheet 1) that is besid
the users selected Round number.
4. copies those 13 cells over to sheet 4

here is the code so far:

Sub commandbutton1_click()

Dim rng As Range
Dim roundNumber As Integer
Dim matchNumber As Variant
Dim rowWithNumber As Variant

roundNumber = InputBox("Enter the Round number for which you would lik
the summary ", "Round Number")

Set rng = Worksheets(1).Range("C4:C12")

matchNumber = Application.Match(roundNumber, rng, 0)
If Not IsError(matchNumber) Then

rowWithNumber = rng.Cells(matchNumber).Address(RowAbsolute:=True)

newrng = rng.Cells(matchNumber).Address.Offset(0, 1), Offset(0
12)
newrng.select
selection.copy
worksheets(2).select
range("B5").select
activesheet.paste

Else
MsgBox "That is not a valid Round number"
End If

End Su

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

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
Copying Named Ranges Tom Perlman Excel Discussion (Misc queries) 4 December 14th 06 07:34 PM
Copying into ranges carlito_1985 Excel Worksheet Functions 1 June 20th 05 03:23 AM
Copying ranges of numbers misterproperty Excel Worksheet Functions 1 December 14th 04 09:51 PM
copying ranges from different workbook phillip harrison Excel Programming 0 July 24th 03 02:34 PM
Copying ranges brym Excel Programming 8 July 19th 03 04:27 PM


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