Hi PHV and combo,
Thanks very much for your guys inputs!
I changed " Range(Cells(a, 1), Cells(l, b)).Select"
to "Range(Cells(1, 1), Cells(b, 12)).Select", and it works now!
However, when I changed it as " Range(Cells(a, A), Cells(l, L)).Select" it stuck again and shows the same prompt as...
I need a macro to print a range from cell "A1" to the last non-zero cell in column L. this is my vba:
Sub findprint()
Dim i As Integer
Dim a As Integer
Dim b As Integer
i = WorksheetFunction.CountIf(Columns(12), 0)
a = WorksheetFunction.CountA(Columns(12))
b = a...
hi Skip,
These are my codes:
Sub processthisbook1()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
Select Case Left(ws.Name, 1)
Case "a"
Call macro1
Case "b"
Call macro2
End Select
Next ws
End Sub
Sub macro1()
Dim...
Hi Skip,
Thanks.
I want macro1 applys to 3 workseets whose name begins with "a", macro2 applys to 2 worksheets name begins with "b". following is my code:
Sub processthisbook()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If InStr(1, ws.Name, "a") > 0 Then
Call...
I have macro1 and macro2 in a workbook with 10 sheets. 3 worksheets' name begins with "a", two begins with "b". Does anyone know how automatically go through all 10 sheets and apply macro1 to 3 "a*" sheets , macro2 to 2 "b*" sheets?
Thanks!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.