PDA

View Full Version : Solved: Copy B4 value of each guide based on column A of worksheet "Plan2"



marreco
10-19-2012, 03:46 PM
Hi.

hi
I need to copy the values ​​of the cell "B4" of all spreadsheets spreadsheets exeto calls ... {"Principal" , "Ficha Modelo" , "Plan2"}

after copying these values​​, they would be pasted on each line of the worksheet "Plan2" of cordo guide with your name.

According to my spreadsheet attachment in "PLan2" I did manual in column "C" values ​​"B4" of cda spreadsheet.

note that the worksheet "Plan2" in column "A" is the name of the tab.

example:
then in "A1" of worksheet "Plan2" I have the number 6, the code should copy the value of "B4" tab name 6 for column "C" worksheet "Plan2"

If in "A2" worksheet "Plan2" I have the number 7, the code should copy the value of "B4" tab name 7 for column "C" worksheet "Plan2"

and so

Cross-Post
http://www.thecodecage.com/forumz/microsoft-excel-forum/213397-copy-b4-value-each-guide-based-column-worksheet-plan2.html

Thank you!!!

p45cal
10-19-2012, 04:21 PM
in cell C1 of Plan2 sheet:
=INDIRECT(A1 & "!D4")
Now copy that formula down.
ps. It's D4 not B4 isn't it?

marreco
10-20-2012, 04:43 AM
Hi
I need VBA.
How do I do this using VBA?

Thank you!

p45cal
10-20-2012, 05:52 AM
With Sheets("Plan2")
Set lr = .Cells(.Rows.Count, "A").End(xlUp).Offset(, 2)
With .Range("C1", lr)
.FormulaR1C1 = "=INDIRECT(RC[-2] & ""!D4"")"
.Value = .Value 'if you want to convert the formulae to hard values.
End With
End With

marreco
10-20-2012, 01:22 PM
hi.
It was great!!

thank you very much!!