Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Error:Expected Array
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 *** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Error:Expected Array
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" wrote in message ... 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 *** |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Error:Expected Array
Try changing: Sheets("PG_results").Select Selection.PasteSpecial Paste:=xlPasteValues("PG_results").Range("B5") to: Sheets("PG_results").Select Range("B5").Select Selection.PasteSpecial Paste:=xlPasteValues or shorter and without selecting: Sheets("PG_results").Range("B5").value=copyFrom.va lue not tested - (in haste). -- p45cal *p45cal* ------------------------------------------------------------------------ p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=144129 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Compile Error: Expected Array | Excel Programming | |||
compile error - expected an array | Excel Programming | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
compile error: Expected: = ...Why? | Excel Programming | |||
Compile Error: Expected End Property | Excel Programming |