Sub Copy_Values()
Dim i As Long
With Sheets("Sheet1")
For i = 1 To 3
Sheets("Sheet" & i + 1).Range("F10").Value = .Range("A" & i + 4).Value
Next i
End With
End Sub
Sorry didn't work maybe I was not clear. I have attached the sample file. I need to copy data from the main sheet from a row to the worksheets. Thanks so much for your quick response.Sub Copy_Values() Dim i As Long With Sheets("Sheet1") For i = 1 To 3 Sheets("Sheet" & i + 1).Range("F10").Value = .Range("A" & i + 4).Value Next i End With End Sub
I have attached the file with the cell references. Hope now it will be clear. Sorry for inconvienance.That image does not clarify anything for me I'm afraid.
It has a column headed Values in main file "N8" but that column contains different values. How can N8 in the main file contain different values?
What does "main file" mean?
What does "main file" mean?
range.xlsm | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | M | N | |||||||||||
1 | ||||||||||||||||
2 | ||||||||||||||||
3 | ||||||||||||||||
4 | ||||||||||||||||
5 | N8 | 3377 | B1-001 | F10 | ||||||||||||
6 | N9 | 3377 | B1-002 | F10 | ||||||||||||
7 | N10 | 3532 | B1-101 | F10 | ||||||||||||
8 | N11 | 3532 | B1-102 | F10 | 3377 | |||||||||||
9 | N12 | 3532 | B1-201 | F10 | 3377 | |||||||||||
10 | N13 | 3532 | B1-202 | F10 | 3532 | |||||||||||
11 | 3532 | |||||||||||||||
12 | 3532 | |||||||||||||||
13 | 3532 | |||||||||||||||
14 | ||||||||||||||||
Sheet1 |
Sub test2()
a = Sheets("sheet1").Cells(5, 1).CurrentRegion '<< sheet1 = main sheet
For i = 1 To UBound(a)
With Sheets(a(i, 3)).Range(a(i, 4))
.Value = Sheets("sheet1").Range(a(i, 1))
End With
Next
End Sub
Those are sheet names in column "C" wherein the values from "N8" has to go "F10" in Sheet name (B1-001). Please see attached sheet names.But they are in column C are they?