Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 468
Default Compile error - help

Is Occuring on last line BEFORE End Sub (below):

Sub Foo()
Dim Rng1 As Range
Dim Rng2 As Range
Dim Rng3 As Range
Dim FindDate As Range
Set FindDate = Sheets("Report").Range("D4")
With Sheets("MyHistory").Range("A:A")
Set x = .Find(What:=FindDate)
End With
Set Rng1 = Sheets("Report").Range("D14")
Set Rng2 = Sheets("Report").Range("A13")
Set Rng3 = Sheets("Report").Range("B1:B4")
Rng1.Copy x.Offset(, 1)
Rng2.Copy x.Offset(, 2)
Rng3.Copy x.Offset(, 3).PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=True
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Compile error - help

Rng3.Copy
' on the next line
x.Offset(, 3).PasteSpecial Paste:=xlPasteAll, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=True

might be an idea to test
if not x is nothing then ' etc

Regards,
Peter T



"JMay" wrote in message
...
Is Occuring on last line BEFORE End Sub (below):

Sub Foo()
Dim Rng1 As Range
Dim Rng2 As Range
Dim Rng3 As Range
Dim FindDate As Range
Set FindDate = Sheets("Report").Range("D4")
With Sheets("MyHistory").Range("A:A")
Set x = .Find(What:=FindDate)
End With
Set Rng1 = Sheets("Report").Range("D14")
Set Rng2 = Sheets("Report").Range("A13")
Set Rng3 = Sheets("Report").Range("B1:B4")
Rng1.Copy x.Offset(, 1)
Rng2.Copy x.Offset(, 2)
Rng3.Copy x.Offset(, 3).PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
_
SkipBlanks:=False, Transpose:=True
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 468
Default Compile error - help

That did it;
pretty simple fix, huh?
shame on me !!


Thanks -- Jim

"Peter T" wrote:

Rng3.Copy
' on the next line
x.Offset(, 3).PasteSpecial Paste:=xlPasteAll, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=True

might be an idea to test
if not x is nothing then ' etc

Regards,
Peter T



"JMay" wrote in message
...
Is Occuring on last line BEFORE End Sub (below):

Sub Foo()
Dim Rng1 As Range
Dim Rng2 As Range
Dim Rng3 As Range
Dim FindDate As Range
Set FindDate = Sheets("Report").Range("D4")
With Sheets("MyHistory").Range("A:A")
Set x = .Find(What:=FindDate)
End With
Set Rng1 = Sheets("Report").Range("D14")
Set Rng2 = Sheets("Report").Range("A13")
Set Rng3 = Sheets("Report").Range("B1:B4")
Rng1.Copy x.Offset(, 1)
Rng2.Copy x.Offset(, 2)
Rng3.Copy x.Offset(, 3).PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
_
SkipBlanks:=False, Transpose:=True
End Sub




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
help with this error-Compile error: cant find project or library JackR Excel Discussion (Misc queries) 2 June 10th 06 09:09 PM
VBAProject name compile error, not defined at compile time Matthew Dodds Excel Programming 1 December 13th 05 07:17 PM
error message: compile error, argument not optional Pierre via OfficeKB.com Excel Programming 3 September 5th 05 03:45 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM


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