Sufiyan97
Well-known Member
- Joined
- Apr 12, 2019
- Messages
- 1,614
- Office Version
- 365
- 2013
- Platform
- Windows
I am using below code by @Anthony47, which is working fine, now I just want to modify code and instead of copying data in to clipboard I want to save each filtered name as separate image in a folder for that it should ask for destination folder and want to name each image same as the name filtered
and I don't want a separate message after each filtered data is saved, I just want final message when all the names from column J filtered and saved.
My Data looks like this
Reference
and I don't want a separate message after each filtered data is saved, I just want final message when all the names from column J filtered and saved.
VBA Code:
Sub SeqToClip_Pict()
Dim fRange As Range, fRC As Long
Dim I As Long, cFilt
'
Set fRange = Range(Range("E1"), Range("E1").End(xlDown).Offset(1, 0)) 'Assuming the table starts in E1
fRC = fRange.Rows.Count
'
For I = 16 To 1000
cFilt = Cells(I, "J").Value
If Len(cFilt) = 0 Then Exit For
fRange.AutoFilter Field:=1, Criteria1:="*" & cFilt & "*"
If fRange.SpecialCells(xlCellTypeVisible).Count > 2 Then 'See message 1
Range(fRange.Cells(1, -1), fRange.Cells(fRC + 3, fRange.Columns.Count)).Copy 'See message 2
Beep
MsgBox ("Copy the clipboard data into WhatsApp Web; destination: " & Cells(I, "J").Value)
End If
Next I
fRange.AutoFilter Field:=1
Application.CutCopyMode = False
MsgBox ("Completed")
End Sub
My Data looks like this
Book1 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
C | D | E | F | G | H | I | J | K | |||
1 | Date | Amount | Name | ||||||||
2 | 9/28/2022 | 5 | A | ||||||||
3 | 9/28/2022 | 5 | A | ||||||||
4 | 1 | 10 | B | ||||||||
5 | 9/29/2022 | 10 | B | ||||||||
6 | 9/30/2022 | 15 | C | ||||||||
7 | 9/30/2022 | 15 | C | ||||||||
8 | 10-01-2022 | 20 | D | ||||||||
9 | 10-01-2022 | 20 | D | ||||||||
10 | 1 | 25 | E | ||||||||
11 | 10-02-2022 | 25 | E | ||||||||
12 | |||||||||||
13 | 150 | Total Quantity | |||||||||
14 | 4500 | Total Amount | |||||||||
15 | |||||||||||
16 | A | ||||||||||
17 | B | ||||||||||
18 | |||||||||||
19 | |||||||||||
20 | |||||||||||
21 | |||||||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C4,C10 | C4 | =B3+1 |
D13 | D13 | =SUBTOTAL(9,D2:D11) |
D14 | D14 | =D13*30 |
Reference
VBA Filter Names from List One by One and then Copy filtered data
I have a data like below I a VBA to Filter Names from List (J16:J20) One by One and then Copy the filtered data: CDEFGHIJKL1NameAmount2A53A54B105B106C157C158D209D2010E2511E251213Total Quantity15014Total Amount45001516A17B18C19D20E2122232425E13E13=SUBTOTAL(9,E2:E11)E14E14=E13*30
www.mrexcel.com