Hi Arvi,
the text you had written did not seem to work though i did change the values
to the correct ones. i have copied my complete macro below to view. when
checking themn the variables are all collecting the right information, i am
not getting an error but the formula is not getting entered into the cell.
Infact, it is not entering anywhere. If you don't mind, could you look at it
and see where i am going wrong please as its confusing me...
Sub GETWIP()
CurrMonth = Range("C15").Text
Range("E15").Select
ActiveCell.FormulaR1C1 = togetvalue
thepath = "=vlookup(C2,C:\Documents and Settings\Nigel Shaw\My Documents\'["
& CurrMonth & ".xls]'Front Order Summary!H12:I36,2)"
getjobcode = Range("C2").Value
If getjobcode = "Complete" Then
MsgBox " you need to enter a job number first and fill the book details
correctly! "
Exit Sub
End If
If getjobcode <> "Complete" Then
togetvalue = thepath
Range("C1").Select
ActiveCell.Select
End If
Exit Sub
End Sub
thanks again,
Nigel
Arvi Laanemets said:
Hi
.....
CurrMonth=Format(Date,"mmmm yyyy")
Sheets("Sheet1").Range("E15").Formula="=vlookup(C2,C:\Documents and
Settings\My Name\My Documents\'[" & CurrMonth & ".xls]'Front Order
Summary!E10:F30,2)"
.....
Arvi Laanemets
Hi, thanks for replying. the only problem is where the variable which
equals
"November 2005" is, has to change every month according to the month of
year.
i have 12 books from jan to dec where i need the data from theses sheets
independently throughout the month in the same cell. i need to compile it
so
i can insert the file name as per month.
thanks,
Nigel
:
Hi
....
Sheets("Sheet1").Range("E15").Formula="=vlookup(C2,C:\Documents and
Settings\My Name\My Documents\'[November 2005.xls]'Front Order
Summary!E10:F30,2)"
....
Arvi Laanemets
Hi,
i was wondering if i could have some help? here are my variables:
getcell = Range("C2").Value
MyPath = "C:\Documents and Settings\My Name\My Documents\"
My File = Range("D15").Text & ".xls"
i need to create a macro to insert a compiled vlookup formula into
cell
E15
The finished formula should be something like:
=vlookup(C2,C:\Documents and Settings\My Name\My Documents\'[November
2005.xls]'Front Order Summary!E10:F30,2)
but i keep getting errors. does anyone have any ideas?
thanks in advance,
NS