Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help me figure out this buG?

my code below fails at the line rTotal.Select. I don't understand why i
won't let me select that code when I run it. However, it works fine i
i step into the function through the debugger. anyone have som
suggestsion?

Set rBally = Range("D10:O12")
Set rBio = Range("D20:O22")
Set rCP = Range("D30:O32")
Set rFS = Range("D40:O42")
Set rLabrada = Range("D50:O52")
Set rMT = Range("D60:O62")
Set rPE = Range("D70:O72")
Set rRP = Range("D80:O82")
Set rSFU = Range("D90:O92")
Set rSFA = Range("D100:O102")
Set rUni = Range("D110:O112")

Workbooks("Bars 2004.xls").Worksheets("Total Bars MASTER").Visibl
= xlSheetVisible
Workbooks.Open ("C:\Documents and Settings\Adam\Desktop\Monthl
Sales\Master.xls")


Workbooks("Bars 2004.xls").Worksheets("Total Bar
MASTER").Activate
Set rTotal = Union(rBally, rBio, rCP, rFS, rLabrada, rMT, rPE, rRP
rSFU, rSFA, rUni)
rTotal.Select
Call CopyPast

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default help me figure out this buG?

Hi
not tested but try the following (a bit more specific
which workbook/worksheet to access. note: In most cases a
selection/activation is not required):

Sub foo()
Dim wbk1 As Workbook
Dim wbk2 As Workbook
Dim wks As Worksheet

Set wbk1 = Workbooks("Bars 2004.xls")
Set wks1 = wbk1.Worksheets("Total Bars MASTER")
With wks1
Set rBally = .Range("D10:O12")
Set rBio = .Range("D20:O22")
Set rCP = .Range("D30:O32")
Set rFS = .Range("D40:O42")
Set rLabrada = .Range("D50:O52")
Set rMT = .Range("D60:O62")
Set rPE = .Range("D70:O72")
Set rRP = .Range("D80:O82")
Set rSFU = .Range("D90:O92")
Set rSFA = .Range("D100:O102")
Set rUni = .Range("D110:O112")
End With
wks1.Visible = xlSheetVisible

Workbooks.Open ("C:\Documents and
Settings\Adam\Desktop\Monthly Sales\Master.xls")
Set wbk2 = ActiveWorkbook

wbk1.Activate
wks1.Activate

Set rTotal = Union(rBally, rBio, rCP, rFS, rLabrada, rMT,
rPE, rRP, rSFU, rSFA, rUni)
rTotal.Select
Call CopyPaste
End Sub

-----Original Message-----
my code below fails at the line rTotal.Select. I don't

understand why it
won't let me select that code when I run it. However, it

works fine if
i step into the function through the debugger. anyone

have some
suggestsion?

Set rBally = Range("D10:O12")
Set rBio = Range("D20:O22")
Set rCP = Range("D30:O32")
Set rFS = Range("D40:O42")
Set rLabrada = Range("D50:O52")
Set rMT = Range("D60:O62")
Set rPE = Range("D70:O72")
Set rRP = Range("D80:O82")
Set rSFU = Range("D90:O92")
Set rSFA = Range("D100:O102")
Set rUni = Range("D110:O112")

Workbooks("Bars 2004.xls").Worksheets("Total Bars

MASTER").Visible
= xlSheetVisible
Workbooks.Open ("C:\Documents and

Settings\Adam\Desktop\Monthly
Sales\Master.xls")


Workbooks("Bars 2004.xls").Worksheets("Total Bars
MASTER").Activate
Set rTotal = Union(rBally, rBio, rCP, rFS, rLabrada, rMT,

rPE, rRP,
rSFU, rSFA, rUni)
rTotal.Select
Call CopyPaste


---
Message posted from http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help me figure out this buG?

agh, that helped me out. i hate when i make stupid errors like that.
just didn't clarify when i was setting all the ranges which is why i
didn't work. but thanks for your help. i spent the last hou
overlooking that

--
Message posted from http://www.ExcelForum.com

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
HOW TO 'BLINK' A FIGURE INSTEAD OFF BOLDING THE FIGURE Nad.Engoor Excel Worksheet Functions 3 December 30th 08 03:04 PM
how to figure cjbarron5 Excel Discussion (Misc queries) 2 May 28th 08 02:04 AM
Can anyone me help figure this out?? Beginner Excel Discussion (Misc queries) 3 August 22nd 07 11:26 PM
Can anyone help me figure this out???? PLEASE???!!!??? SuzieinNC Excel Discussion (Misc queries) 3 August 22nd 07 10:16 PM
Still trying to figure it out Robertgn Excel Worksheet Functions 2 December 10th 05 12:44 PM


All times are GMT +1. The time now is 02:40 AM.

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

About Us

"It's about Microsoft Excel"