LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
higherlimits
 
Posts: n/a
Default Method 'Range' of object '_global' failed


hey, I'm kinda new at Macros and I'm not sure how to fix this error.

here is my code..sorry for the lack of comments, I haven't finished
them yet.
when I hit 'debug' it highlights the last line before End Sub. Oh, and
this doesn't happen with all the inputs, just some.

Sub Copy()
' This Macros allows the user to simply select their
' Choices from a listbox and hit a button to send data to the
' appropriate worksheets.

Dim Cell
Dim Destination
Dim Number
Dim getfrom
Dim Address
Dim GetProg
Dim GetNum
Dim GetMonth
Dim GetMonthLet

' this tells the macros what worksheet to send the data to
getfrom = Range("F7")
Number = getfrom + 6

Address = Range("C" & Number)
GetProg = Range("G7")
If GetProg < 17 Then
DestNum = GetProg + 9
ElseIf GetProg = 17 Then
DestNum = 34
ElseIf GetProg = 18 Then
DestNum = 39

End If

GetMonth = Range("H7")
If GetMonth = 1 Then
GetMonthLet = "D"
ElseIf GetMonth = 2 Then
GetMonthLet = "E"
ElseIf GetMonth = 3 Then
GetMonthLet = "F"
ElseIf GetMonth = 4 Then
GetMonthLet = "G"
ElseIf GetMonth = 5 Then
GetMonthLet = "H"
ElseIf GetMonth = 6 Then
GetMonthLet = "I"
ElseIf GetMonth = 7 Then
GetMonthLet = "J"
ElseIf GetMonth = 8 Then
GetMonthLet = "K"
ElseIf GetMonth = 9 Then
GetMonthLet = "L"
ElseIf GetMonth = 10 Then
GetMonthLet = "M"
ElseIf GetMonth = 11 Then
GetMonthLet = "N"
ElseIf GetMonth = 12 Then
GetMonthLet = "O"
ElseIf GetMonth = 13 Then
GetMonthLet = "D"
ElseIf GetMonth = 14 Then
GetMonthLet = "E"
ElseIf GetMonth = 15 Then
GetMonthLet = "F"
End If

Destination = Address & "!" & GetMonthLet & DestNum

Range("I7").Copy Destination:=Range(Destination)


End Sub


--
higherlimits
------------------------------------------------------------------------
higherlimits's Profile: http://www.excelforum.com/member.php...o&userid=34841
View this thread: http://www.excelforum.com/showthread...hreadid=546062

 
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
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Using a worksheet name from a range RPH Excel Worksheet Functions 3 January 27th 06 08:40 PM
Range object without blank cells RMJames Excel Discussion (Misc queries) 1 January 24th 06 02:15 PM
ClearContents method on a passed range bryan New Users to Excel 2 January 19th 05 08:49 AM
Formula to list unique values JaneC Excel Worksheet Functions 4 December 10th 04 12:25 AM


All times are GMT +1. The time now is 10:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"