Amenolakaky
New Member
- Joined
- Feb 17, 2022
- Messages
- 14
- Office Version
- 2016
- Platform
- Windows
Hello all, this my first time to use the VBA and actually i started my first project also i'm a big fan for this community, appreciated
I got a codes from many sites to do the below
1- 'Open method has additional parameters '(This code done)
2-lCopyLastRow2 = wsCopy.Cells(wsCopy.Rows.Count, "D").End(xlUp).Row '(This code done)
3-wsDest.Range("A" & lDestLastRow).PasteSpecial Paste:=xlPasteValues''(This code done)
i succeed to select my data till the last row then open the destination sheet and paste my data.
the issue is !
i need to set if condition after identifying the range & last row = If the new section range "E11:E" & lst row equal "Building/Physical" or "Building/OneClick" then IF MID "D11:D" & LAST ROW equal "3601" then copy and past it in sheet names "SSS" After identifying the last row and past the new data.
else
If the new section range "E11:E" & lst row equal "Building/Physical" or "Building/OneClick" then IF MID "D11:D" & LAST ROW equal "44001" then copy and past it in sheet names "kkk" After identifying the last row and past the new data.
else
If the new section range "E11:E" & lst row equal "Building/Physical" or "Building/OneClick" then IF MID "D11:D" & LAST ROW equal "5500" then copy and past it in sheet names "uuu" After identifying the last row and past the new data.
else
If the new section range "E11:E" & lst row equal "Building/Physical" or "Building/OneClick" then IF MID "D11:D" & LAST ROW equal "6600" then copy and past it in sheet names "uuu" After identifying the last row and past the new data.
If the new section range "E11:E" & lst row equal "Building/Physical" or "Building/OneClick" then IF MID "D11:D" & LAST ROW equal "E360" then copy and past it in sheet names "EEE" After identifying the last row and past the new data.
else
If the new section range "E11:E" & lst row equal "Building/Physical" or "Building/OneClick" then IF MID "D11:D" & LAST ROW equal "E440" then copy and past it in sheet names "TTT" After identifying the last row and past the new data.
...............................................
Please note that every day i open a new sheet with today's name from this source
i have the first code which bring data and paste it in the destination sheet, i just need to set the if as i mentioned above "In the mail sheet or destination sheet" same will be useful.
Many thanks in advance
I got a codes from many sites to do the below
1- 'Open method has additional parameters '(This code done)
2-lCopyLastRow2 = wsCopy.Cells(wsCopy.Rows.Count, "D").End(xlUp).Row '(This code done)
3-wsDest.Range("A" & lDestLastRow).PasteSpecial Paste:=xlPasteValues''(This code done)
i succeed to select my data till the last row then open the destination sheet and paste my data.
the issue is !
i need to set if condition after identifying the range & last row = If the new section range "E11:E" & lst row equal "Building/Physical" or "Building/OneClick" then IF MID "D11:D" & LAST ROW equal "3601" then copy and past it in sheet names "SSS" After identifying the last row and past the new data.
else
If the new section range "E11:E" & lst row equal "Building/Physical" or "Building/OneClick" then IF MID "D11:D" & LAST ROW equal "44001" then copy and past it in sheet names "kkk" After identifying the last row and past the new data.
else
If the new section range "E11:E" & lst row equal "Building/Physical" or "Building/OneClick" then IF MID "D11:D" & LAST ROW equal "5500" then copy and past it in sheet names "uuu" After identifying the last row and past the new data.
else
If the new section range "E11:E" & lst row equal "Building/Physical" or "Building/OneClick" then IF MID "D11:D" & LAST ROW equal "6600" then copy and past it in sheet names "uuu" After identifying the last row and past the new data.
If the new section range "E11:E" & lst row equal "Building/Physical" or "Building/OneClick" then IF MID "D11:D" & LAST ROW equal "E360" then copy and past it in sheet names "EEE" After identifying the last row and past the new data.
else
If the new section range "E11:E" & lst row equal "Building/Physical" or "Building/OneClick" then IF MID "D11:D" & LAST ROW equal "E440" then copy and past it in sheet names "TTT" After identifying the last row and past the new data.
...............................................
Please note that every day i open a new sheet with today's name from this source
i have the first code which bring data and paste it in the destination sheet, i just need to set the if as i mentioned above "In the mail sheet or destination sheet" same will be useful.
Many thanks in advance