PC Review


Reply
Thread Tools Rate Thread

Compile Error:Expected Array

 
 
Fatima CN
Guest
Posts: n/a
 
      15th Oct 2009
Hi,
I am getting an error as (Compile Error:Expected Array) when i am
running the below macro.Pls help me to debug it


Sub copyVisible()
Dim copyFrom As Range
Set copyFrom = ThisWorkbook.Sheets("Analysis").Range("C5")
Do
Set copyFrom = copyFrom.Offset(1)
Loop Until copyFrom.EntireRow.Hidden = False
copyFrom.Copy
Sheets("PG_results").Select
Selection.PasteSpecial Paste:=xlPasteValues("PG_results").Range("B5")
Application.CutCopyMode = False
End Sub





*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
Tim Williams
Guest
Posts: n/a
 
      15th Oct 2009
You can skip the copy/paste and just assign the value directly

> Sub copyVisible()
> Dim copyFrom As Range
> Set copyFrom = ThisWorkbook.Sheets("Analysis").Range("C5")
> Do
> Set copyFrom = copyFrom.Offset(1)
> Loop Until copyFrom.EntireRow.Hidden = False


Sheets("PG_results").Range("B5").Value = copyFrom.Value

> End Sub



Tim


"Fatima CN" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
> I am getting an error as (Compile Error:Expected Array) when i am
> running the below macro.Pls help me to debug it
>
>
> Sub copyVisible()
> Dim copyFrom As Range
> Set copyFrom = ThisWorkbook.Sheets("Analysis").Range("C5")
> Do
> Set copyFrom = copyFrom.Offset(1)
> Loop Until copyFrom.EntireRow.Hidden = False
> copyFrom.Copy
> Sheets("PG_results").Select
> Selection.PasteSpecial Paste:=xlPasteValues("PG_results").Range("B5")
> Application.CutCopyMode = False
> End Sub
>
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: compile error: expected array. Bob Quintal Microsoft Access Forms 2 28th Jun 2010 12:09 AM
Compile Error: Expected Array BEEJAY Microsoft Excel Programming 7 8th Dec 2008 08:23 PM
Array compile error "Expected: As" eschloss Microsoft Access VBA Modules 4 10th Oct 2008 12:46 AM
compile error - expected an array =?Utf-8?B?Sm9obg==?= Microsoft Excel Programming 8 21st Sep 2006 08:04 PM
Help: Compile error: type mismatch: array or user defined type expected lvcha.gouqizi Microsoft Excel Programming 1 31st Oct 2005 08:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:09 PM.