Hi There,
I have a macro that used to work and now it's not any more, trying to
diagnose what's going on. Code snipit:
'takes text value from QIF entries and pastes them into
column I, values are pasted as text
if (dateOption = "DD/MM/YYYY") then
pasteValue =
mid(currentCellValue,5,2)&"."&mid(currentCellValue,2,2)&"."&mid(currentCellValue,8,4)
pasteSheet.getCellByPosition(8,pasteRow).String = pasteValue
'takes text values from column I and converts them to a
date, which is then placed in column B
pasteValue = "=DATE(VALUE(MID(I" & pasteRow+1
&",7,4)),VALUE(MID(I" & pasteRow+1 &",1,2)), VALUE(MID(I" & pasteRow+1
&",4,2))"
pasteSheet.getCellByPosition(1,pasteRow).String = pasteValue
end if
the trouble is with these lines:
pasteValue = "=DATE(VALUE(MID(I" & pasteRow+1
&",7,4)),VALUE(MID(I" & pasteRow+1 &",1,2)), VALUE(MID(I" & pasteRow+1
&",4,2))"
pasteSheet.getCellByPosition(1,pasteRow).String = pasteValue
The problem is that the formula is being pasted as text (with a ' in
front) so it's not actually performing the formula function which I
need. I know it makes sense that it's being pasted as text it's a STRING
. . . just not sure how to get the formula (or at least the value that
it carries) into the value "pasteValue" so that it's pasted as a date
(which is what it's doing). I know this seems really weird but it's
transforming a QIF file to a spreadsheet format which then has nifty
details (such as moving averages, graphs, etc . . .).
Suggestion really welcome as this is related to my finances and
currently my macro is pretty broken because of this. Thanks!
Best,
Joel
Best,
Joel