Output text vba should run10000 rows batch wise on every run till it ends.

Sathish G

New Member
Joined
Aug 16, 2017
Messages
44
Office Version
  1. 2013
Platform
  1. Windows
Hi Experts,

I need some experts help to modify my present codes to run every 10000 rows values on next next execution.

example on 1st execution it should print 1 to 10000 row values, then on next execution 10001 to 20000 rows values to be print. Like that till values end in "Data" source sheet.

Sub Add()

Set filePath1 = [Details!C5]

Open filePath1 For Output As #1

Set Source = Worksheets("Data")
Set detail = Worksheets("Details")

LastRow = Source.Cells(Source.Rows.Count, "A").End(xlUp).Row
LastCol = Source.Range("XFD1").End(xlToLeft).Column

inputrow = 2
rownum = 2
colnum = 1


For rownum = 2 To LastRow
If Source.Cells(rownum, 1).Value = Source.Cells(rownum, 2).Value Then

Else

outputText = [Details!C7] & Source.Cells(rownum, 1).Value & [Details!C8] & Source.Cells(rownum, 1).Value & [Details!C9]
Print #1, outputText

outputText = [Details!C10]
Print #1, outputText

End If
Next

Close #1

End Sub
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top