I'm having trouble putting the syntax together for this and I just started working with FSO in VBA, so please bear with me.
fsofol.name = test1 (this is correct)
I'm trying to determine if each cell has any data in column "A" and if so, put the name of the folder in the offset cell I have listed. I'm hoping I'm close, but if anyone can help with a suggestion I would be grateful. Thanks!
I put a note in the problem line below
Dim fsoFol As Object
If fileName Like "V*.xls" Then
wbkCS.Worksheets("Cut Sheet").Range("S4:S2000").Copy
With wbkVer.Worksheets("Cutsheets")
Set firstRange = .Range("A" & .Rows.Count).End(xlUp).Offset(1, 0)
firstRange.PasteSpecial xlPasteValues
If firstRange.Value Like "*" Then
fsoFol.Name.Copy **'error is here and states object required**
firstRange.Offset(0, 5).PasteSpecial xlPasteValues
End If
End With
Assuming that FSO is the
Scripting.FileSystemObject
and that you want to work through all of the "V*.xls" files in a folder called "test1", you're missing a few steps:Creating the file system object
Assigning the folder
Working through the files
Open a specific Excel file and assign it to a variable
I'm unclear on what you are trying to do with the cells copied into wbkVer. You're copying nearly 2000 cells but only looking at the value of the first cell copied. Also the test
Like "*"
will return True for both empty cells and cells with values so it probably isn't what you need. If you can clarify that requirement then we can move things on a bitChange
to