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
--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Context
- [libreoffice-users] macro pasting text instead of formula · Joel Madero
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.