ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   need macro help (https://www.excelbanter.com/excel-programming/348742-need-macro-help.html)

[email protected]

need macro help
 
I need to save data to file by macro.

I have a small project that need to split one big file to splitted
files (by 50 Lines for file)
I read the data file to excel and need to write macro for splitting
I need the command for save to file (lines/rows)

Please help


mcg

need macro help
 
try:
1.add one coulmn ( assume it would be 10th column ) with row number
paste into module
For m = 1 To ActiveSheet.UsedRange.Rows.Count Step 50
Selection.AutoFilter Field:=10, Criteria1:="" & m - 1,
Operator:=xlAnd, Criteria2:="<" & m + 49
Range("a1").CurrentRegion .Copy
Sheets.Add
ActiveSheet.Paste
ActiveWorkbook.SaveAs your name
ActiveWorkbook.Close
ActiveSheet.ShowAllData
Next m


mcg



All times are GMT +1. The time now is 01:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com