Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Strange error??

Hello everybody!!

I spent a lot of time on a curious bug, and I wanted your advise.
I created a function that must simlpy copy some cells in another range.
This function take a range object as parameter to determine source of
datas to copy:

Public Function PuF_FormatCpyField(V_Range As Range)

' If there is more than 1 project imported, we copy/paste
' the formula to all rows containing data
If GV_NumProjects 1 Then
With V_Range.Worksheet
V_Range.Rows(2).Copy _
(.Range(.Cells(3, V_Range.Column), .Cells(GV_NumProjects
+ 1, V_Range.Column + V_Range.Columns.Count - 1)))
End If
End With
End Function

.... but this doesn't work, and a beautiful "Copy Method of Range class
failed" occurs...

I've been able to solve this problem by changing
With V_Range.Worksheet
by
With Worksheets("NameOfMyWorksheet")

I really don't understand why this problem happens... Does somebody
have an idea?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Strange error??

I found a better solution:
With Worksheets(V_Range.Worksheet.Name)
This one works perfectly great...

This problem sounds like an Excel bug, don't you think?

I thought that perhaps my ranges were erroneous, but doing
V_Range.Rows(2).Activate
or
(.Range(.Cells(3, V_Range.Column), .Cells(GV_NumProjects
+ 1, V_Range.Column + V_Range.Columns.Count - 1)).Activate

works perfectly... Only he copy function doesn't work...

Strange, isn't it?

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
strange error martinbarnes Excel Discussion (Misc queries) 3 April 1st 08 09:02 PM
strange error AD108 Excel Worksheet Functions 7 August 9th 06 09:22 AM
Strange error Andy Setting up and Configuration of Excel 1 April 18th 06 08:11 PM
Very strange error superkopite Excel Discussion (Misc queries) 3 February 19th 06 11:21 AM
Strange error Filips Benoit Excel Programming 7 October 20th 04 08:02 PM


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