Problem with the range format

dwg83

Board Regular
Joined
Nov 8, 2006
Messages
174
I am hoping someone can help me identify what is wrong with using this line in my code:


FrontPage.Range(Cells(UtilityRow, 50), Cells(UtilityRow, 64)).Select

FrontPage is defined as a worksheet
UtilityRow is defined as an integer defining which row my utility is on

Thanks!
David
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
You need to fully qualify the range

Code:
Application.Goto FrontPage.Range(FrontPage.Cells(UtilityRow, 50),FrontPage.Cells(UtilityRow, 64))
 
Upvote 0
With that Goto command, will my focus now be set on that worksheet, or will the active sheet remain the same?
 
Upvote 0
Perhaps I can do this a different way...I am just trying to copy some formulas saved on a "repository" sheet to my active sheet. Does the code below do it the most efficient way?

Thanks!

Code:
        'Imports Formulas
        FrontPage.Range(Cells(UtilityRow, 50), Cells(UtilityRow, 64)).Select
        Selection.Copy
        Range("AC10").Select
        Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
 
Upvote 0
try

Code:
FrontPage.Range(Cells(FrontPage.UtilityRow, 50), FrontPage.Cells(UtilityRow, 64)).Copy
Range("AC10").PasteSpecial Paste:=xlPasteFormulas
 
Upvote 0
I tried your last suggestion (without the "goto" statement) and the error that occurs (I think it's the same error) is:

Method 'Range' of object '_Worksheet' failed
 
Upvote 0
Fixed! In the code you provided, the second "FrontPage." should have been in front of "Cells" rather than UtilityRow. Thanks for your help!

Code:
FrontPage.Range(FrontPage.Cells(UtilityRow, 50), FrontPage.Cells(UtilityRow, 64)).Copy
Range("AC10").PasteSpecial Paste:=xlPasteFormulas
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,738
Members
452,940
Latest member
Lawrenceiow

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top