Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends,
i need help actually am using one source file that contains 2012, 2013,2014,2015 years data i have created straight table loaded all the data and for user friendly i have created macro for CSV file. till now its no issue's but user asking for new csv file that contains only 2012 and 2013 years data.
please help is there any condition for macro.
Hi Before exporting you can select the required year rite?? and then use the below macro
Sub exp()
set obj = ActiveDocument.GetSheetObject("CH01")
obj.ExportBiff "C:\test.csv"
End Sub
this should do...or create a separate button with action to select the year's you required and then trigger the macro export
Hi Avinash,
Thanks for reply that is fine, instead of creating separate sheet is there any possibility to apply filter at macro level.
not sure , try like this: Create a field with required year or set values in the E
Sub exp()
ActiveDocument.GetApplication.WaitForIdle
set LB=ActiveDocument.GetSheetObject("List Box ID")
LB.Activate
E=LB.GetPossibleValues
i=lbound(E)
ActiveDocument.Fields("Field name").select E(i)
set obj = ActiveDocument.GetSheetObject("CH01")
obj.ExportBiff "C:\test.csv"
End Sub