Move to specific sheet and cell based on criteria entered on anothersheet

S

stvn.taylor

Hi All,

I would appreciate some assistance with the following:

In cell A1 on "sheet 1" I have the name of another sheet within the
same workbook, say "sheet 2".
In cell A2 on "sheet 1" I have the row and column address listed of a
cell on "sheet 2" say "C2".

What I needed is some VBA code that will go to "sheet 1" look-up the
name of another sheet
as well as the cell address on the specified sheet and then move to
the specific address and
then enter a sum formula for a predetermined range.

Does anybody have an idea on how to accomplish the above?

Thanks,

Steve
 
P

paul.robinson

Hi
Try this

Public Sub tester()
With ActiveSheet

Worksheets(.Range("A1").Value).Range(.Range("A2").Value).FormulaR1C1 =
"=sum(R4C2:R6C2)"
Worksheets(.Range("A1").Value).Activate
End With
End Sub

careful with the line wrap in the editor.
From the activesheet, this will go to the sheet name in A1 and take
the address on that sheet in A2 and put the sum formula in it. The sum
is for rows 4 to 6 in column 2

regards
Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top