Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can anyone please help me in this regards...
I want to split the data in diiferent workbook and save it in new folder.( every time i split the data the macro should create new folder for it) I have data which contains credit and debit details of the clients, i want to split that data from customer code and save it in foleder with file name (which contains client code in it ) Please provide me the required VBL query......trying hard for many days but still not succeded. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Amol
Try the workbook example http://www.rondebruin.nl/copy5.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Amol" wrote in message ups.com... Can anyone please help me in this regards... I want to split the data in diiferent workbook and save it in new folder.( every time i split the data the macro should create new folder for it) I have data which contains credit and debit details of the clients, i want to split that data from customer code and save it in foleder with file name (which contains client code in it ) Please provide me the required VBL query......trying hard for many days but still not succeded. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jul 20, 10:57 pm, "Ron de Bruin" wrote:
Hi Amol Try the workbook examplehttp://www.rondebruin.nl/copy5.htm -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "Amol" wrote in oglegroups.com... Can anyone please help me in this regards... I want to split the data in diiferent workbook and save it in new folder.( every time i split the data the macro should create new folder for it) I have data which contains credit and debit details of the clients, i want to split that data from customer code and save it in foleder with file name (which contains client code in it ) Please provide me the required VBL query......trying hard for many days but still not succeded.- Hide quoted text - - Show quoted text - Its not working.... i have no idea where the file got saved Plus there is one sheet added in existing data sheet.... No folder name, no file saved with customer name...... Result = Total confussion |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You must use
http://www.rondebruin.nl/copy5.htm#4) What have you changed in my example -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Amol" wrote in message oups.com... On Jul 20, 10:57 pm, "Ron de Bruin" wrote: Hi Amol Try the workbook examplehttp://www.rondebruin.nl/copy5.htm -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "Amol" wrote in oglegroups.com... Can anyone please help me in this regards... I want to split the data in diiferent workbook and save it in new folder.( every time i split the data the macro should create new folder for it) I have data which contains credit and debit details of the clients, i want to split that data from customer code and save it in foleder with file name (which contains client code in it ) Please provide me the required VBL query......trying hard for many days but still not succeded.- Hide quoted text - - Show quoted text - Its not working.... i have no idea where the file got saved Plus there is one sheet added in existing data sheet.... No folder name, no file saved with customer name...... Result = Total confussion |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jul 20, 11:16 pm, "Ron de Bruin" wrote:
You must usehttp://www.rondebruin.nl/copy5.htm#4) What have you changed in my example -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "Amol" wrote in ooglegroups.com... On Jul 20, 10:57 pm, "Ron de Bruin" wrote: Hi Amol Try the workbook examplehttp://www.rondebruin.nl/copy5.htm -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "Amol" wrote in oglegroups.com... Can anyone please help me in this regards... I want to split the data in diiferent workbook and save it in new folder.( every time i split the data the macro should create new folder for it) I have data which contains credit and debit details of the clients, i want to split that data from customer code and save it in foleder with file name (which contains client code in it ) Please provide me the required VBL query......trying hard for many days but still not succeded.- Hide quoted text - - Show quoted text - Its not working.... i have no idea where the file got saved Plus there is one sheet added in existing data sheet.... No folder name, no file saved with customer name...... Result = Total confussion- Hide quoted text - - Show quoted text - on which location the folder got saved??? Its just a run macro and add one sheet with no date just a hearder..... I think i am not able to explain what i want.........if provide the exact query for same and not a link |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Please read the information on the site and use the correct example
Check if the information in these lines is correct before you run the macro. Name of the worksheet with your data table Set ws1 = Sheets("Sheet1") '<<< Change Data range: A1 is the top left cell of your filter range and the header of the first column, and D is the last column in the filter range. Set rng = ws1.Range("A1:D" & Rows.Count) You can change the filter column to another column, my range starts in A so the 1 in my example is the A column(2 = B, 3 =C,...............) rng.Columns(1).AdvancedFilter _ -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Amol" wrote in message ups.com... On Jul 20, 11:16 pm, "Ron de Bruin" wrote: You must usehttp://www.rondebruin.nl/copy5.htm#4) What have you changed in my example -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "Amol" wrote in ooglegroups.com... On Jul 20, 10:57 pm, "Ron de Bruin" wrote: Hi Amol Try the workbook examplehttp://www.rondebruin.nl/copy5.htm -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "Amol" wrote in oglegroups.com... Can anyone please help me in this regards... I want to split the data in diiferent workbook and save it in new folder.( every time i split the data the macro should create new folder for it) I have data which contains credit and debit details of the clients, i want to split that data from customer code and save it in foleder with file name (which contains client code in it ) Please provide me the required VBL query......trying hard for many days but still not succeded.- Hide quoted text - - Show quoted text - Its not working.... i have no idea where the file got saved Plus there is one sheet added in existing data sheet.... No folder name, no file saved with customer name...... Result = Total confussion- Hide quoted text - - Show quoted text - on which location the folder got saved??? Its just a run macro and add one sheet with no date just a hearder..... I think i am not able to explain what i want.........if provide the exact query for same and not a link |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jul 20, 11:16 pm, "Ron de Bruin" wrote:
You must usehttp://www.rondebruin.nl/copy5.htm#4) What have you changed in my example -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "Amol" wrote in ooglegroups.com... On Jul 20, 10:57 pm, "Ron de Bruin" wrote: Hi Amol Try the workbook examplehttp://www.rondebruin.nl/copy5.htm -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "Amol" wrote in oglegroups.com... Can anyone please help me in this regards... I want to split the data in diiferent workbook and save it in new folder.( every time i split the data the macro should create new folder for it) I have data which contains credit and debit details of the clients, i want to split that data from customer code and save it in foleder with file name (which contains client code in it ) Please provide me the required VBL query......trying hard for many days but still not succeded.- Hide quoted text - - Show quoted text - Its not working.... i have no idea where the file got saved Plus there is one sheet added in existing data sheet.... No folder name, no file saved with customer name...... Result = Total confussion- Hide quoted text - - Show quoted text - Hi Robin File got saved with this macro but the sheet is blank there is no data in that saved files....i want all filter data in that sheet everything works fine till creating folder and saving with Customer code i.e filter range.....but the sheet is blank Please help |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() you can use the following macro: Sub CopyData() Dim LMainWB As String Dim LNewWB As String Dim LRow As Integer Dim LContinue As Boolean Dim LColAMaster As String Dim LColATest As String Dim LWBCount As Integer Dim LMsg As String Dim LPath As String Dim LFilename As String Dim LColAValue As String 'Path to save all new workbooks to LPath = "C:\" 'Retrieve name of the workbook that contains the data LMainWB = ActiveWorkbook.Name 'Initialize variables LContinue = True LRow = 2 LWBCount = 0 'Start comparing with cell A2 LColAMaster = "A2" 'Loop through all column A values until a blank cell is found While LContinue = True LRow = LRow + 1 LColATest = "A" & CStr(LRow) 'Found a blank cell, do not continue If Len(Range(LColATest).Value) = 0 Then LContinue = False End If 'Value in column A LColAValue = Range(LColAMaster).Value 'Found occurrence that did not match, copy data to new workbook If LColAValue < Range(LColATest).Value Then 'Copy headings Range("A1:D1").Select Selection.Copy 'Add new workbook and paste headings into new workbook Workbooks.Add LNewWB = ActiveWorkbook.Name ActiveSheet.Paste Range("A1").Select 'Copy data from columns A - D Windows(LMainWB).Activate Range(LColAMaster & ":D" & CStr(LRow - 1)).Select Selection.Copy 'Paste results Windows(LNewWB).Activate Range("A2").Select ActiveSheet.Paste Range("A1").Select 'Save (and overwrite, if necessary) workbook with name from column A 'and then close workbook LFilename = LPath & LColAValue & ".xls" If Dir(LFilename) < "" Then Kill LFilename ActiveWorkbook.SaveAs Filename:=LFilename ActiveWorkbook.Close 'Go back to Main sheet and continue where left off Windows(LMainWB).Activate LColAMaster = "A" & CStr(LRow) 'Keep track of the number of workbooks that have been created LWBCount = LWBCount + 1 End If Wend Range("A1").Select Application.CutCopyMode = False LMsg = "Copy has completed. " & LWBCount & " new workbooks have been created." LMsg = LMsg & Chr(10) & "You can find them in the following directory:" & Chr(10) & LPath MsgBox LMsg End Sub *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
When I save a workbook(2007) w/ a data connection to htm no data? | Excel Discussion (Misc queries) | |||
Split data from 1 workbook into multiple workbooks based on criter | Excel Worksheet Functions | |||
1.Open workbook. 2 copy data. 3 replace data. 4 save workbook. | Excel Programming | |||
save data in another workbook | Excel Programming | |||
split data in many workbook | Excel Programming |