Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 385
Default Referencing worksheet

How do you get this formula to work when the worksheet is not active. i want
the macro pull the formula down but i don't want the user to see the
worksheet that this is all happening on.
Range("f2", Range("a2").End(xlDown)).Offset(0, 5).FillDown
--
Thank you,

Jennifer
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 417
Default Referencing worksheet

Something like:

With Worksheets("Sheet1")
.Range("f2", .Range("a2").End(xlDown)).Offset(0, 5).FillDown
End with

Make sure you put periods in front of all Range and Cell properties, as
shown above.

I normally do a little more work programming, and use object variables, to
make single-stepping (and therefore debugging) easier (untested):

Dim wsSheet1 as Worksheet
Dim rngA2Data as Range
Dim rngFillRange as Range

Set wsSheet1 = Worksheets("Sheet1")
With wsSheet1
Set rngA2Data = .Range("A2").End(xlDown)
Set rngFillRange = .Range("F2").Resize(rngA2Data.Rows.Count)
End With

rngFillRange.FillDown

FYI: You might check out some of the Excel MVP web sites for more help.
http://www.mvps.org/links.html#Excel
--
Regards,
Bill Renaud



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 385
Default Referencing worksheet

Thank you. Like you thought i was trying it the way you wrote it but was
forgetting the periods and it wouldn't work. Ha. Thanks.
--
Thank you,

Jennifer


"Bill Renaud" wrote:

Something like:

With Worksheets("Sheet1")
.Range("f2", .Range("a2").End(xlDown)).Offset(0, 5).FillDown
End with

Make sure you put periods in front of all Range and Cell properties, as
shown above.

I normally do a little more work programming, and use object variables, to
make single-stepping (and therefore debugging) easier (untested):

Dim wsSheet1 as Worksheet
Dim rngA2Data as Range
Dim rngFillRange as Range

Set wsSheet1 = Worksheets("Sheet1")
With wsSheet1
Set rngA2Data = .Range("A2").End(xlDown)
Set rngFillRange = .Range("F2").Resize(rngA2Data.Rows.Count)
End With

rngFillRange.FillDown

FYI: You might check out some of the Excel MVP web sites for more help.
http://www.mvps.org/links.html#Excel
--
Regards,
Bill Renaud




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
Referencing a value on a different worksheet David Gerstman Excel Discussion (Misc queries) 11 December 4th 07 09:58 PM
Referencing a Worksheet newguy Excel Discussion (Misc queries) 3 December 12th 06 07:31 PM
CountIF() in Worksheet B while referencing cells in Worksheet A jfj3rd Excel Worksheet Functions 3 April 14th 06 11:24 PM
CountIF() in Worksheet B while referencing cells in Worksheet A jfj3rd Excel Worksheet Functions 3 April 14th 06 07:36 PM
referencing another worksheet chartasap Excel Worksheet Functions 2 July 13th 05 01:58 PM


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