Thread: Macro Help
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
SeanC UK[_3_] SeanC UK[_3_] is offline
external usenet poster
 
Posts: 48
Default Macro Help

Hi Craig,

Try something like this:

Worksheets("Sheet2").Range("H38").Formula = "=Sheet1!$H$35"
Worksheets("Sheet2").Range(Cells(38, 9), Cells(38, 30)).Formula = "=$H$38"

Change the Sheet2 and Sheet1 to your tab names. I have simply referenced the
cells directly as your question requests. Obviously you can now amend the
formula to represent any worksheet function you need.

Hope this helps,

Sean.

--
(please remember to click yes if replies you receive are helpful to you)


"Craig" wrote:

I am a novice at macros and need a little help.

In Tab 1 I have a value in cell H35.

What I want to do is have the Macro go to Cell h38 in Tab 2 and have that
cell put a formula to reference cell H35 on Tab 1. Then in Cell I38:AD38 in
Tab 2 I want it to reference cell h38 of Tab 2.

I tried to record a Macro to do this and it keeps giving me errors. I have
tried switching between relative reference and not and I still have an
error. So obviously I am doing something wrongs. Anyone have a code that
will enable me to do this.

Thanks in advance.