How to paste the value of cell of another worksheet?

  • Thread starter Thread starter Telesphore
  • Start date Start date
T

Telesphore

In the following I am trying to replace Range("A46") by a cell of another
worksheets?

******************************************************************
Private Sub Worksheet_Activate()
Worksheets("Table").PageSetup.LeftFooter = Format(Date, "d / mmmm /
yyyy")
Worksheets("Table").PageSetup.CenterFooter = Range("A46").Value
End Sub
******************************************************************

Thank you.
 
You have to tell it what sheet:

******************************************************************
Private Sub Worksheet_Activate()
Worksheets("Table").PageSetup.LeftFooter = _
Format(Date, "d / mmmm /yyyy")
Worksheets("Table").PageSetup.CenterFooter = _
worksheets("Sheet1").Range("A46").Value
End Sub
******************************************************************

as an example.
 
Thank you so much.

Now I need to change the value format! It gives me 64,9909090909091 and I
would like 64.

First time progamming in Excel!
 
Private Sub Worksheet_Activate()
Worksheets("Table").PageSetup.LeftFooter = _
Format(Date, "d / mmmm /yyyy")
Worksheets("Table").PageSetup.CenterFooter = _
Format(worksheets("Sheet1").Range("A46").Value,"0")
End Sub

would give you 65 which is what I think you want.

from the immediate window in the VBE
? format(64.9909090909091,"0")
65
 
Thank you very much. It works.

Last night, after trying and trying, I succeeded with your suggestion,
changing "Value" by "Text", and it worked too?

Private Sub Worksheet_Activate()
Worksheets("Table").PageSetup.LeftFooter = _
Format(Date, "d / mmmm /yyyy")
Worksheets("Table").PageSetup.CenterFooter = _
worksheets("Sheet1").Range("A46").Text
End Sub
 
Back
Top