I've added an additional image to this. The DocType column is copied to this sheet automatically from the "Doc Types" sheet. The content can change and range in how many cells are filled out. So formula creates first column, I need the vb to then evaluate the results of the File Path column and copy "C:\test\images\tester.TIF"
how ever many times necessary to the file path that is created there. The code below that I currently have is much more simple but I have no idea which direction to go with this.
Sub CopyEmTWO() Dim ws As Worksheet Dim strIn As String Dim strOut As String Dim strFile As String Dim strLPart As String Dim strRPart As String Dim lngCnt As String Dim lngFiles As Long Set ws = Sheets("MRT") lngCnt = Application.CountA(ws.Columns("A")) If lngCnt = 0 Then Exit Sub strIn = "C:\inserver6\script\Toolbelt\MRTesting\" strOut = "C:\inserver6\script\Toolbelt\MRTesting\" strFile = "MRTesting.tif" 'extract string portions of the file name and type outside the copy loop strLPart = Left$(strFile, InStr(strFile, ".") - 1) strRPart = Right$(strFile, Len(strFile) - Len(strLPart)) For lngFiles = 1 To lngCnt FileCopy strIn & strFile, strOut & strLPart & "(" & lngFiles & ")" & strRPart Next End Sub
I'm still a newbie and I've taken an 8 hour stab at this one and can't get it right. Here is my working code for simply enumerating and duplicating. If it needs an entirely different approach please offer any ideas you have. Thanks in advance.