GirishDhruva
Active Member
- Joined
- Mar 26, 2019
- Messages
- 308
Hi Everyone,
Below i have a code which copies based on cell values(Highlighted) but instead of cell values, can we copy through cell name (Cell names which would be only in "Column C")
Cell names would be : Id,Name,class,div,sub1,sub2,sub3,sub4,sub5
Regards,
Dhruva
Below i have a code which copies based on cell values(Highlighted) but instead of cell values, can we copy through cell name (Cell names which would be only in "Column C")
Rich (BB code):
FolderName = Worksheets("copy").Cells(2, "K").Value & "\"
If FolderName <> "\" Then
FileName = Dir(FolderName & "*.xl*")
If FileName <> "" Then
Application.ScreenUpdating = False
While FileName <> ""
Set wbTarget = Workbooks.Open(FileName:=FolderName & FileName, UpdateLinks:=False, ReadOnly:=True)
i = 1
For Each cell In wbTarget.Sheets(1).Range("D4:D5,D8,F14:F19").Cells
arr(i) = cell.Value
i = i + 1
Next cell
With FBP
.Cells(.Cells(.Rows.Count, "A").End(xlUp).Row + 1, 1).Resize(, UBound(arr)).Value = arr
End With
wbTarget.Close False
Set wbTarget = Nothing
Erase arr
FileName = Dir
Wend
Application.ScreenUpdating = True
Cell names would be : Id,Name,class,div,sub1,sub2,sub3,sub4,sub5
Regards,
Dhruva
Last edited: