View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dave Marden[_6_] Dave Marden[_6_] is offline
external usenet poster
 
Posts: 14
Default How do I getting data from another worksheet?

Thanks Tom for the assistance, I have gotten that to work but if you
look at my next problem I would appreciate it. My program is all protected
and many data ranges are hidden such as the actual position where data is
entered via a userform. I need to get ranges such as X4:X27 into the new
version of the program. For some reason this doesn't seem to be working for
me. Here is what I have so far, any help would be appreciated. I can't
imagine having to do each cell individually, but when I select multiple cell
ranges the program seems to just ignore the request as in no error and no
copy.

The line with 'Names is my problem area now.

Thanks In Advance,
Dave Marden


Private Sub cmdRead_Click()
Dim wbName As String, bk As Workbook
Dim bClosed As Boolean
wbName = Range("ReadFromFilename").Value
On Error Resume Next
Set bk = Workbooks(wbName)
On Error GoTo 0
If bk Is Nothing Then
bClosed = True
Set bk = Workbooks.Open(wbName)
End If
'Getting Data From Old Version
'Handicap
Workbooks("Data Gatherer For
Scoreboard.xls").Worksheets("Sheet1").Range("Handi cap") =
bk.Worksheets("Competitors A-Z").Range("D29")
'Archery League Name
Workbooks("Data Gatherer For
Scoreboard.xls").Worksheets("Sheet1").Range("Arche ryLeagueName") =
bk.Worksheets("League's Score Board").Range("ArcheryLeagueName")
'Max Make-Up Scores
Workbooks("Data Gatherer For
Scoreboard.xls").Worksheets("Sheet1").Range("MaxMa keupScores") =
bk.Worksheets("Competitors A-Z").Range("MaxMakeupScores")
'Names
Workbooks("Data Gatherer For
Scoreboard.xls").Worksheets("Sheet1").Range("B2:B2 5") =
bk.Worksheets("Competitors A-Z").Range("X4:X27")


If bClosed Then bk.Close Savechanges:=False
End Sub