How to make a auto counter to print pages

0 votes

The first macro that sorts it needs a reference in a cell that goes based on account number, which we have as F01 0001 to F01 2000 then F02 all the way to F14. Is there a way to make the cell go F01 0001 then sort then print then go F01 0002 automatically and loop the processes until it's done? I have two macros, one to sort the excel sheet by account number and one to print the page and put a pdf in a folder.

Sub Automake()
    For Each r In Range("E8")
        r.Value = r.Value + 1
        run filter e by e:8
        run produceinv
    Next r
End Sub
Jan 19, 2023 in Others by Kithuzzz
• 38,000 points
430 views

1 answer to this question.

0 votes

This will loop through all of those account numbers:

Option Explicit
Sub Filter_And_Sum()

    Dim lPrefix As Long
    Dim lCount As Long
    Dim Account_Number As String
    
    For lPrefix = 1 To 14
        For lCount = 1 To 2000
            Account_Number = "F" & Format(lPrefix, "00") & " " & Format(lCount, "0000")
            Debug.Print Account_Number
            
            ' Do something ...
            
        Next lCount
    Next lPrefix
    
End Sub
answered Jan 19, 2023 by narikkadan
• 63,600 points

Related Questions In Others

0 votes
1 answer

How to make a countdown timer in Android?

package com.example.countdowntimer; import java.util.concurrent.TimeUnit; import android.app.Activity; import android.os.Bundle; import android.os.CountDownTimer; import android.widget.TextView; public ...READ MORE

answered Jun 1, 2022 in Others by nisha
• 2,210 points
2,342 views
0 votes
1 answer

How to print the next row every time a function runs? (openpyxl)

Verify the indentation. I executed the sample ...READ MORE

answered Jan 7, 2023 in Others by narikkadan
• 63,600 points
1,265 views
0 votes
1 answer

How to make an error flagging array in VBA and translate all array elements as a string message?

In my opinion, using an array in ...READ MORE

answered Mar 17, 2023 in Others by Kithuzzz
• 38,000 points
524 views
0 votes
1 answer

Why does WinHTTPRequest responseText return a different value to MsgBox than Debug.Print dynamic web pages

The Immediate pane has a built-in limit ...READ MORE

answered Mar 18, 2023 in Others by narikkadan
• 63,600 points
965 views
0 votes
1 answer

Generate VCards from Excel using VBA

Solution  Create a class called CContact with getters ...READ MORE

answered Nov 21, 2022 in Others by narikkadan
• 63,600 points
752 views
0 votes
1 answer

VBA Loop To Import Changing File Names

You can use a FOR loop and ...READ MORE

answered Jan 12, 2023 in Others by narikkadan
• 63,600 points
869 views
0 votes
1 answer

Is there a hierarchy inferring algorithm available in python?

Convert the list of values to the ...READ MORE

answered Jan 15, 2023 in Others by narikkadan
• 63,600 points
415 views
0 votes
1 answer

How to rename a workbook other than using (Name) and (FileSystemObject. MoveFile)?

Use  SHFileOperation API Option Explicit Private Declare PtrSafe Function SHFileOperation ...READ MORE

answered Feb 11, 2023 in Others by Kithuzzz
• 38,000 points
442 views
0 votes
1 answer

How to make Component Variant in Google Optimize A/B testing in Next js

Render all the components in ReactJs after ...READ MORE

answered Feb 18, 2022 in Others by narikkadan
• 63,600 points
932 views
0 votes
1 answer

Excel VBA : HOW TO PRINT THE TEXT IN A CELL (like Wrap Text)

Use a LineFeed character to create a ...READ MORE

answered Oct 27, 2022 in Others by narikkadan
• 63,600 points
1,025 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP