This is the code
for where a4 is i'm trying to do a test to see if that cell is blank before filling the value. couldnt get it to work. Also that cell has a formula in it, its a if then to either fill it with a text value or make it = ""
this code outputs cell data into 1 sheet from many workbooks. i just want it to skip putting a value in the J column if there is nothing in C29 in the sheet aka a4
Code:
Sub LoopThruBooks1()
Dim p, f, s, a, r, a1, a2, a3, a4, a5
p = ThisWorkbook.path & "\All Quotes\"
f = Dir(p & "*.xls*")
s = "Enter Info for Quote"
a = "C18"
a1 = "C3"
a2 = "C13"
a3 = "C19"
a4 = "C29"
r = 1 'The row is starts on (binary)0 = row 1 and 1 = row 2 etc..
Do While f <> ""
r = r + 1
Range("B" & r) = GetValue(p, f, s, a)
Range("C" & r) = GetValue(p, f, s, a1)
Range("D" & r) = GetValue(p, f, s, a2)
Range("E" & r) = GetValue(p, f, s, a3)
a5 = GetValue(p, f, s, a4)
If a5 <> "" Then
Range("J" & r) = GetValue(p, f, s, a4)
End If
f = Dir()
Loop
End Sub
for where a4 is i'm trying to do a test to see if that cell is blank before filling the value. couldnt get it to work. Also that cell has a formula in it, its a if then to either fill it with a text value or make it = ""
this code outputs cell data into 1 sheet from many workbooks. i just want it to skip putting a value in the J column if there is nothing in C29 in the sheet aka a4