VBA program Copy Paste Email

needtoknownow

New Member
Joined
Apr 28, 2013
Messages
17
I have made a example of something similar to what i want to accomplish below. Basically I would like to have the excel file filter itself one employee at a time by employee #. Then copy and paste the filtered data to a seperate excel file and name it after the employee with the current date. I then want the file to be emailed to them as an attachment. I have 2 tabs one with the info; and the other with the emploee name, num, and email. Thank you for any assistance possible. i have been working on this and reding a book call excel 2010 power programming with VBA. But i am coming along slowly.LOL

Sheet2
NameEmp# Email
Jimmy Jimmy1jimmy@work555.com
Tommy Tommy2Tommy@work555.cocm
Richard Richard3Richard@work555.com

<tbody>
</tbody><colgroup><col><col><col></colgroup>











Sheet1
Department VPSales Repemp IDItemDescriptiontrademarkweek 1week 2week3week4week5week6week7week8week9week10week11week12week13week14week15week16week17week18week19week20week21week22week23week24week25week26week27week28week29week30week31week32week33week34week35week36week37week38week39week40week41week42week43week44week45week46week47week48week49week50week51week52
boss of the bossesJimmy Jimmy11Cake 11188.07182.53157.28151.25147.65166.54173.61156.25134.58172.10162.50177.25164.64143.45190.51214.42227.12197.75260.63225.63194.03190.43318.33327.05305.45298.51317.79310.08275.37287.71323.96274.13264.44298.28320.68369.540.000.000.000.00194.03190.43318.33327.05305.45298.51317.79310.08275.37287.71323.96274.13
boss of the bossesJimmy Jimmy12Cake 22120.55117.24111.0797.6499.40101.0487.52100.9992.8387.1097.42105.5793.34116.5986.55101.76100.17114.08123.70112.29119.59110.52189.07174.21179.99164.96181.22192.38180.45167.37175.45154.14153.76172.25162.02194.500.000.000.000.00119.59110.52189.07174.21179.99164.96181.22192.38180.45167.37175.45154.14
boss of the bossesJimmy Jimmy13Cake 33111.85117.4486.7085.2979.5884.3791.5885.7286.0092.5694.0192.9398.69111.36122.8894.10102.87104.89107.51114.32104.59106.34184.01196.04170.98158.45176.79167.11154.59148.94158.63140.88137.90153.72164.93195.89183.50180.910.000.00104.59106.34184.01196.04170.98158.45176.79167.11154.59148.94158.63140.88
boss of the bossesJimmy Jimmy14Cake 41124.91154.46119.91129.49126.12127.60122.05120.68128.07141.96148.11129.99143.41139.74180.97165.63176.38180.46171.34173.62159.04173.85256.64230.27232.79213.72236.56227.43241.09248.15265.10208.49220.23263.90248.06237.42249.12249.59250.18229.14159.04173.85256.64230.27232.79213.72236.56227.43241.09248.15265.10208.49
boss of the bossesJimmy Jimmy15Cake 52195.37163.94155.07143.28124.44139.87147.82146.60136.42169.66135.69130.71143.98164.99148.65145.37143.88146.27152.46150.19164.86148.09238.89215.49245.24196.91250.38213.55243.81223.64240.87209.42217.01235.370.000.000.000.000.000.00164.86148.09238.89215.49245.24196.91250.38213.55243.81223.64240.87209.42
boss of the bossesJimmy Jimmy16Cake 63173.57124.69127.02129.02112.01139.45108.62118.23100.10124.96111.05114.42120.49141.41145.05148.68136.41136.69153.94134.24149.73156.81276.83221.83235.63219.67247.12235.46266.79207.07242.31202.59207.96223.58253.49264.220.000.000.000.00149.73156.81276.83221.83235.63219.67247.12235.46266.79207.07242.31202.59
boss of the bossesJimmy Jimmy17Cake 71145.30147.20126.16135.81157.21125.22127.20123.82136.33144.35133.63139.93142.83139.01135.20153.66180.30173.76182.61175.63157.00165.99255.10202.67189.37190.50210.82225.59235.77199.05232.67228.69199.61231.04254.15272.940.000.000.000.00157.00165.99255.10202.67189.37190.50210.82225.59235.77199.05232.67228.69
boss of the bossesJimmy Jimmy18Cake 82186.81160.43135.53107.28152.21157.54172.97170.55173.72182.71159.44194.50209.65195.58215.75193.25226.19237.22265.28220.73214.88199.06350.01296.39296.39276.57327.82318.24334.18323.07334.66300.00276.37318.42352.67404.62391.16347.91321.96275.35214.88199.06350.01296.39296.39276.57327.82318.24334.18323.07334.66300.00
boss of the bossesJimmy Jimmy19Cake 93166.03167.16158.91139.48148.41135.85133.78131.17141.70150.61148.54133.15153.29152.98159.35189.63194.92167.90202.29205.40180.92169.40270.19237.64258.99241.47254.61243.31263.37223.95277.61246.77250.05269.15318.29335.82315.73309.740.000.00180.92169.40270.19237.64258.99241.47254.61243.31263.37223.95277.61246.77
boss of the bossesJimmy Jimmy110Cake 101139.28145.22101.39105.4392.60101.33100.8099.29100.51117.01123.04109.04132.16126.19137.76137.94144.65145.77147.05137.92142.35138.82194.63188.68182.15159.86190.22194.64203.45167.44200.01165.04193.69180.20199.51228.13227.03206.080.000.00142.35138.82194.63188.68182.15159.86190.22194.64203.45167.44200.01165.04
boss of the bossesJimmy Jimmy111Cake 112188.07182.53157.28151.25147.65166.54173.61156.25134.58172.10162.50177.25164.64143.45190.51214.42227.12197.75260.63225.63194.03190.43318.33327.05305.45298.51317.79310.08275.37287.71323.96274.13264.44298.28320.68369.540.000.000.000.00194.03190.43318.33327.05305.45298.51317.79310.08275.37287.71323.96274.13
boss of the bossesJimmy Jimmy112Cake 123120.55117.24111.0797.6499.40101.0487.52100.9992.8387.1097.42105.5793.34116.5986.55101.76100.17114.08123.70112.29119.59110.52189.07174.21179.99164.96181.22192.38180.45167.37175.45154.14153.76172.25162.02194.500.000.000.000.00119.59110.52189.07174.21179.99164.96181.22192.38180.45167.37175.45154.14
boss of the bossesTommy Tommy213Cake 131111.85117.4486.7085.2979.5884.3791.5885.7286.0092.5694.0192.9398.69111.36122.8894.10102.87104.89107.51114.32104.59106.34184.01196.04170.98158.45176.79167.11154.59148.94158.63140.88137.90153.72164.93195.89183.50180.910.000.00104.59106.34184.01196.04170.98158.45176.79167.11154.59148.94158.63140.88
boss of the bossesTommy Tommy214Cake 142124.91154.46119.91129.49126.12127.60122.05120.68128.07141.96148.11129.99143.41139.74180.97165.63176.38180.46171.34173.62159.04173.85256.64230.27232.79213.72236.56227.43241.09248.15265.10208.49220.23263.90248.06237.42249.12249.59250.18229.14159.04173.85256.64230.27232.79213.72236.56227.43241.09248.15265.10208.49
boss of the bossesTommy Tommy215Cake 153195.37163.94155.07143.28124.44139.87147.82146.60136.42169.66135.69130.71143.98164.99148.65145.37143.88146.27152.46150.19164.86148.09238.89215.49245.24196.91250.38213.55243.81223.64240.87209.42217.01235.370.000.000.000.000.000.00164.86148.09238.89215.49245.24196.91250.38213.55243.81223.64240.87209.42
boss of the bossesTommy Tommy216Cake 161173.57124.69127.02129.02112.01139.45108.62118.23100.10124.96111.05114.42120.49141.41145.05148.68136.41136.69153.94134.24149.73156.81276.83221.83235.63219.67247.12235.46266.79207.07242.31202.59207.96223.58253.49264.220.000.000.000.00149.73156.81276.83221.83235.63219.67247.12235.46266.79207.07242.31202.59
boss of the bossesTommy Tommy217Cake 172145.30147.20126.16135.81157.21125.22127.20123.82136.33144.35133.63139.93142.83139.01135.20153.66180.30173.76182.61175.63157.00165.99255.10202.67189.37190.50210.82225.59235.77199.05232.67228.69199.61231.04254.15272.940.000.000.000.00157.00165.99255.10202.67189.37190.50210.82225.59235.77199.05232.67228.69
boss of the bossesTommy Tommy218Cake 183186.81160.43135.53107.28152.21157.54172.97170.55173.72182.71159.44194.50209.65195.58215.75193.25226.19237.22265.28220.73214.88199.06350.01296.39296.39276.57327.82318.24334.18323.07334.66300.00276.37318.42352.67404.62391.16347.91321.96275.35214.88199.06350.01296.39296.39276.57327.82318.24334.18323.07334.66300.00
boss of the bossesTommy Tommy219Cake 191166.03167.16158.91139.48148.41135.85133.78131.17141.70150.61148.54133.15153.29152.98159.35189.63194.92167.90202.29205.40180.92169.40270.19237.64258.99241.47254.61243.31263.37223.95277.61246.77250.05269.15318.29335.82315.73309.740.000.00180.92169.40270.19237.64258.99241.47254.61243.31263.37223.95277.61246.77
boss of the bossesTommy Tommy220Cake 202139.28145.22101.39105.4392.60101.33100.8099.29100.51117.01123.04109.04132.16126.19137.76137.94144.65145.77147.05137.92142.35138.82194.63188.68182.15159.86190.22194.64203.45167.44200.01165.04193.69180.20199.51228.13227.03206.080.000.00142.35138.82194.63188.68182.15159.86190.22194.64203.45167.44200.01165.04
boss of the bossesTommy Tommy221Cake 213188.07182.53157.28151.25147.65166.54173.61156.25134.58172.10162.50177.25164.64143.45190.51214.42227.12197.75260.63225.63194.03190.43318.33327.05305.45298.51317.79310.08275.37287.71323.96274.13264.44298.28320.68369.540.000.000.000.00194.03190.43318.33327.05305.45298.51317.79310.08275.37287.71323.96274.13
boss of the bossesTommy Tommy222Cake 221120.55117.24111.0797.6499.40101.0487.52100.9992.8387.1097.42105.5793.34116.5986.55101.76100.17114.08123.70112.29119.59110.52189.07174.21179.99164.96181.22192.38180.45167.37175.45154.14153.76172.25162.02194.500.000.000.000.00119.59110.52189.07174.21179.99164.96181.22192.38180.45167.37175.45154.14
boss of the bossesTommy Tommy223Cake 232111.85117.4486.7085.2979.5884.3791.5885.7286.0092.5694.0192.9398.69111.36122.8894.10102.87104.89107.51114.32104.59106.34184.01196.04170.98158.45176.79167.11154.59148.94158.63140.88137.90153.72164.93195.89183.50180.910.000.00104.59106.34184.01196.04170.98158.45176.79167.11154.59148.94158.63140.88
boss of the bossesTommy Tommy224Cake 243124.91154.46119.91129.49126.12127.60122.05120.68128.07141.96148.11129.99143.41139.74180.97165.63176.38180.46171.34173.62159.04173.85256.64230.27232.79213.72236.56227.43241.09248.15265.10208.49220.23263.90248.06237.42249.12249.59250.18229.14159.04173.85256.64230.27232.79213.72236.56227.43241.09248.15265.10208.49
boss of the bossesTommy Tommy225Cake 251195.37163.94155.07143.28124.44139.87147.82146.60136.42169.66135.69130.71143.98164.99148.65145.37143.88146.27152.46150.19164.86148.09238.89215.49245.24196.91250.38213.55243.81223.64240.87209.42217.01235.370.000.000.000.000.000.00164.86148.09238.89215.49245.24196.91250.38213.55243.81223.64240.87209.42
boss of the bossesTommy Tommy226Cake 262173.57124.69127.02129.02112.01139.45108.62118.23100.10124.96111.05114.42120.49141.41145.05148.68136.41136.69153.94134.24149.73156.81276.83221.83235.63219.67247.12235.46266.79207.07242.31202.59207.96223.58253.49264.220.000.000.000.00149.73156.81276.83221.83235.63219.67247.12235.46266.79207.07242.31202.59
boss of the bossesTommy Tommy227Cake 273145.30147.20126.16135.81157.21125.22127.20123.82136.33144.35133.63139.93142.83139.01135.20153.66180.30173.76182.61175.63157.00165.99255.10202.67189.37190.50210.82225.59235.77199.05232.67228.69199.61231.04254.15272.940.000.000.000.00157.00165.99255.10202.67189.37190.50210.82225.59235.77199.05232.67228.69
boss of the bossesTommy Tommy228Cake 281186.81160.43135.53107.28152.21157.54172.97170.55173.72182.71159.44194.50209.65195.58215.75193.25226.19237.22265.28220.73214.88199.06350.01296.39296.39276.57327.82318.24334.18323.07334.66300.00276.37318.42352.67404.62391.16347.91321.96275.35214.88199.06350.01296.39296.39276.57327.82318.24334.18323.07334.66300.00
boss of the bossesTommy Tommy229Cake 292166.03167.16158.91139.48148.41135.85133.78131.17141.70150.61148.54133.15153.29152.98159.35189.63194.92167.90202.29205.40180.92169.40270.19237.64258.99241.47254.61243.31263.37223.95277.61246.77250.05269.15318.29335.82315.73309.740.000.00180.92169.40270.19237.64258.99241.47254.61243.31263.37223.95277.61246.77
boss of the bossesTommy Tommy230Cake 303139.28145.22101.39105.4392.60101.33100.8099.29100.51117.01123.04109.04132.16126.19137.76137.94144.65145.77147.05137.92142.35138.82194.63188.68182.15159.86190.22194.64203.45167.44200.01165.04193.69180.20199.51228.13227.03206.080.000.00142.35138.82194.63188.68182.15159.86190.22194.64203.45167.44200.01165.04
boss of the bossesTommy Tommy231Cake 311188.07182.53157.28151.25147.65166.54173.61156.25134.58172.10162.50177.25164.64143.45190.51214.42227.12197.75260.63225.63194.03190.43318.33327.05305.45298.51317.79310.08275.37287.71323.96274.13264.44298.28320.68369.540.000.000.000.00194.03190.43318.33327.05305.45298.51317.79310.08275.37287.71323.96274.13
boss of the bossesTommy Tommy232Cake 322120.55117.24111.0797.6499.40101.0487.52100.9992.8387.1097.42105.5793.34116.5986.55101.76100.17114.08123.70112.29119.59110.52189.07174.21179.99164.96181.22192.38180.45167.37175.45154.14153.76172.25162.02194.500.000.000.000.00119.59110.52189.07174.21179.99164.96181.22192.38180.45167.37175.45154.14
boss of the bossesTommy Tommy233Cake 333111.85117.4486.7085.2979.5884.3791.5885.7286.0092.5694.0192.9398.69111.36122.8894.10102.87104.89107.51114.32104.59106.34184.01196.04170.98158.45176.79167.11154.59148.94158.63140.88137.90153.72164.93195.89183.50180.910.000.00104.59106.34184.01196.04170.98158.45176.79167.11154.59148.94158.63140.88
boss of the bossesTommy Tommy234Cake 341124.91154.46119.91129.49126.12127.60122.05120.68128.07141.96148.11129.99143.41139.74180.97165.63176.38180.46171.34173.62159.04173.85256.64230.27232.79213.72236.56227.43241.09248.15265.10208.49220.23263.90248.06237.42249.12249.59250.18229.14159.04173.85256.64230.27232.79213.72236.56227.43241.09248.15265.10208.49
boss of the bossesTommy Tommy235Cake 352195.37163.94155.07143.28124.44139.87147.82146.60136.42169.66135.69130.71143.98164.99148.65145.37143.88146.27152.46150.19164.86148.09238.89215.49245.24196.91250.38213.55243.81223.64240.87209.42217.01235.370.000.000.000.000.000.00164.86148.09238.89215.49245.24196.91250.38213.55243.81223.64240.87209.42
boss of the bossesTommy Tommy236Cake 363173.57124.69127.02129.02112.01139.45108.62118.23100.10124.96111.05114.42120.49141.41145.05148.68136.41136.69153.94134.24149.73156.81276.83221.83235.63219.67247.12235.46266.79207.07242.31202.59207.96223.58253.49264.220.000.000.000.00149.73156.81276.83221.83235.63219.67247.12235.46266.79207.07242.31202.59
boss of the bossesTommy Tommy237Cake 371145.30147.20126.16135.81157.21125.22127.20123.82136.33144.35133.63139.93142.83139.01135.20153.66180.30173.76182.61175.63157.00165.99255.10202.67189.37190.50210.82225.59235.77199.05232.67228.69199.61231.04254.15272.940.000.000.000.00157.00165.99255.10202.67189.37190.50210.82225.59235.77199.05232.67228.69
boss of the bossesTommy Tommy238Cake 382186.81160.43135.53107.28152.21157.54172.97170.55173.72182.71159.44194.50209.65195.58215.75193.25226.19237.22265.28220.73214.88199.06350.01296.39296.39276.57327.82318.24334.18323.07334.66300.00276.37318.42352.67404.62391.16347.91321.96275.35214.88199.06350.01296.39296.39276.57327.82318.24334.18323.07334.66300.00
boss of the bossesTommy Tommy239Cake 393166.03167.16158.91139.48148.41135.85133.78131.17141.70150.61148.54133.15153.29152.98159.35189.63194.92167.90202.29205.40180.92169.40270.19237.64258.99241.47254.61243.31263.37223.95277.61246.77250.05269.15318.29335.82315.73309.740.000.00180.92169.40270.19237.64258.99241.47254.61243.31263.37223.95277.61246.77
boss of the bossesTommy Tommy240Cake 401139.28145.22101.39105.4392.60101.33100.8099.29100.51117.01123.04109.04132.16126.19137.76137.94144.65145.77147.05137.92142.35138.82194.63188.68182.15159.86190.22194.64203.45167.44200.01165.04193.69180.20199.51228.13227.03206.080.000.00142.35138.82194.63188.68182.15159.86190.22194.64203.45167.44200.01165.04
boss of the bossesTommy Tommy241Cake 412188.07182.53157.28151.25147.65166.54173.61156.25134.58172.10162.50177.25164.64143.45190.51214.42227.12197.75260.63225.63194.03190.43318.33327.05305.45298.51317.79310.08275.37287.71323.96274.13264.44298.28320.68369.540.000.000.000.00194.03190.43318.33327.05305.45298.51317.79310.08275.37287.71323.96274.13
boss of the bossesTommy Tommy242Cake 423120.55117.24111.0797.6499.40101.0487.52100.9992.8387.1097.42105.5793.34116.5986.55101.76100.17114.08123.70112.29119.59110.52189.07174.21179.99164.96181.22192.38180.45167.37175.45154.14153.76172.25162.02194.500.000.000.000.00119.59110.52189.07174.21179.99164.96181.22192.38180.45167.37175.45154.14
boss of the bossesTommy Tommy243Cake 431111.85117.4486.7085.2979.5884.3791.5885.7286.0092.5694.0192.9398.69111.36122.8894.10102.87104.89107.51114.32104.59106.34184.01196.04170.98158.45176.79167.11154.59148.94158.63140.88137.90153.72164.93195.89183.50180.910.000.00104.59106.34184.01196.04170.98158.45176.79167.11154.59148.94158.63140.88
boss of the bossesTommy Tommy244Cake 442124.91154.46119.91129.49126.12127.60122.05120.68128.07141.96148.11129.99143.41139.74180.97165.63176.38180.46171.34173.62159.04173.85256.64230.27232.79213.72236.56227.43241.09248.15265.10208.49220.23263.90248.06237.42249.12249.59250.18229.14159.04173.85256.64230.27232.79213.72236.56227.43241.09248.15265.10208.49
boss of the bossesTommy Tommy245Cake 453195.37163.94155.07143.28124.44139.87147.82146.60136.42169.66135.69130.71143.98164.99148.65145.37143.88146.27152.46150.19164.86148.09238.89215.49245.24196.91250.38213.55243.81223.64240.87209.42217.01235.370.000.000.000.000.000.00164.86148.09238.89215.49245.24196.91250.38213.55243.81223.64240.87209.42
boss of the bossesTommy Tommy246Cake 461173.57124.69127.02129.02112.01139.45108.62118.23100.10124.96111.05114.42120.49141.41145.05148.68136.41136.69153.94134.24149.73156.81276.83221.83235.63219.67247.12235.46266.79207.07242.31202.59207.96223.58253.49264.220.000.000.000.00149.73156.81276.83221.83235.63219.67247.12235.46266.79207.07242.31202.59
boss of the bossesTommy Tommy247Cake 472145.30147.20126.16135.81157.21125.22127.20123.82136.33144.35133.63139.93142.83139.01135.20153.66180.30173.76182.61175.63157.00165.99255.10202.67189.37190.50210.82225.59235.77199.05232.67228.69199.61231.04254.15272.940.000.000.000.00157.00165.99255.10202.67189.37190.50210.82225.59235.77199.05232.67228.69
boss of the bossesTommy Tommy248Cake 483186.81160.43135.53107.28152.21157.54172.97170.55173.72182.71159.44194.50209.65195.58215.75193.25226.19237.22265.28220.73214.88199.06350.01296.39296.39276.57327.82318.24334.18323.07334.66300.00276.37318.42352.67404.62391.16347.91321.96275.35214.88199.06350.01296.39296.39276.57327.82318.24334.18323.07334.66300.00
boss of the bossesTommy Tommy249Cake 491166.03167.16158.91139.48148.41135.85133.78131.17141.70150.61148.54133.15153.29152.98159.35189.63194.92167.90202.29205.40180.92169.40270.19237.64258.99241.47254.61243.31263.37223.95277.61246.77250.05269.15318.29335.82315.73309.740.000.00180.92169.40270.19237.64258.99241.47254.61243.31263.37223.95277.61246.77
boss of the bossesTommy Tommy250Cake 502139.28145.22101.39105.4392.60101.33100.8099.29100.51117.01123.04109.04132.16126.19137.76137.94144.65145.77147.05137.92142.35138.82194.63188.68182.15159.86190.22194.64203.45167.44200.01165.04193.69180.20199.51228.13227.03206.080.000.00142.35138.82194.63188.68182.15159.86190.22194.64203.45167.44200.01165.04
boss of the bossesRichard Richard351Cake 513188.07182.53157.28151.25147.65166.54173.61156.25134.58172.10162.50177.25164.64143.45190.51214.42227.12197.75260.63225.63194.03190.43318.33327.05305.45298.51317.79310.08275.37287.71323.96274.13264.44298.28320.68369.540.000.000.000.00194.03190.43318.33327.05305.45298.51317.79310.08275.37287.71323.96274.13
boss of the bossesRichard Richard352Cake 521120.55117.24111.0797.6499.40101.0487.52100.9992.8387.1097.42105.5793.34116.5986.55101.76100.17114.08123.70112.29119.59110.52189.07174.21179.99164.96181.22192.38180.45167.37175.45154.14153.76172.25162.02194.500.000.000.000.00119.59110.52189.07174.21179.99164.96181.22192.38180.45167.37175.45154.14
boss of the bossesRichard Richard353Cake 532111.85117.4486.7085.2979.5884.3791.5885.7286.0092.5694.0192.9398.69111.36122.8894.10102.87104.89107.51114.32104.59106.34184.01196.04170.98158.45176.79167.11154.59148.94158.63140.88137.90153.72164.93195.89183.50180.910.000.00104.59106.34184.01196.04170.98158.45176.79167.11154.59148.94158.63140.88
boss of the bossesRichard Richard354Cake 543124.91154.46119.91129.49126.12127.60122.05120.68128.07141.96148.11129.99143.41139.74180.97165.63176.38180.46171.34173.62159.04173.85256.64230.27232.79213.72236.56227.43241.09248.15265.10208.49220.23263.90248.06237.42249.12249.59250.18229.14159.04173.85256.64230.27232.79213.72236.56227.43241.09248.15265.10208.49
boss of the bossesRichard Richard355Cake 551195.37163.94155.07143.28124.44139.87147.82146.60136.42169.66135.69130.71143.98164.99148.65145.37143.88146.27152.46150.19164.86148.09238.89215.49245.24196.91250.38213.55243.81223.64240.87209.42217.01235.370.000.000.000.000.000.00164.86148.09238.89215.49245.24196.91250.38213.55243.81223.64240.87209.42
boss of the bossesRichard Richard356Cake 562173.57124.69127.02129.02112.01139.45108.62118.23100.10124.96111.05114.42120.49141.41145.05148.68136.41136.69153.94134.24149.73156.81276.83221.83235.63219.67247.12235.46266.79207.07242.31202.59207.96223.58253.49264.220.000.000.000.00149.73156.81276.83221.83235.63219.67247.12235.46266.79207.07242.31202.59
boss of the bossesRichard Richard357Cake 573145.30147.20126.16135.81157.21125.22127.20123.82136.33144.35133.63139.93142.83139.01135.20153.66180.30173.76182.61175.63157.00165.99255.10202.67189.37190.50210.82225.59235.77199.05232.67228.69199.61231.04254.15272.940.000.000.000.00157.00165.99255.10202.67189.37190.50210.82225.59235.77199.05232.67228.69

<tbody>
</tbody><colgroup><col><col><col><col><col><col><col><col span="2"><col span="3"><col><col span="3"><col><col span="4"><col><col span="4"><col span="3"><col span="2"><col span="3"><col><col span="3"><col><col span="3"><col span="2"><col span="2"><col span="12"></colgroup>
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi..

I enjoyed doing this.. :)

Funnily enough.. I actually got more than half way though creating this and accidently closed the Workbook (before saving it)... had to write the code again... one of those 'doh' moments..

I have shown below how part of my test data looked.. although my entire test data had all 52 weeks in it (out to column BF).

This Sub will do everything you asked..

It will:

* Filter your employees one by one and then copy the data for each employees to sheet 3.
* It will then create a New Workbook and copy the data from Sheet3 to this new workbook.
* It will then save the New Workbook with the Employees name and the date appended to it..
* It will then create a new Outlook email.. addressed to the Employee (as per that employees email address on Sheet2).
* It will also attach the newly created workbook ( the one that was named as per the Employees name)..

Let me know how it goes for you...

Code:
Sub a()


Dim temp As String
Dim strTo As String
Dim LastRow As Long
Dim LastRow2 As Long
Dim LastRow3 As Long
Dim j As Long
Dim Crit1 As Long
Dim Crit2 As Long
Dim Flname As String
Dim Fval As String
Dim DateToday As String
Dim WBClose As String


DateToday = Format(Date, "mmm-dd-yy")
LastRow = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row


For j = 2 To LastRow
If Sheets("Sheet1").Cells(j, 3) = Sheets("Sheet1").Cells(j, 3).Offset(-1, 0) Then
GoTo 1
End If
Crit1 = Sheets("Sheet1").Cells(j, 3)
Sheets("Sheet1").Range("A1:C1").AutoFilter Field:=3, Criteria1:=Crit1


LastRow2 = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
Sheets("Sheet1").Activate
Sheets("Sheet1").Range("A1:BF" & LastRow2).Select
  Selection.Copy
  Flname = Sheets("Sheet1").Cells(j, 2).Value
  If ActiveSheet.AutoFilterMode Then ActiveSheet.AutoFilterMode = False
 
         
  Sheets("Sheet3").Activate
  Sheets("Sheet3").Cells(1, 1).Select
  Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
  False, Transpose:=False
 
    If Flname <> "" Then
        Set NewWkbk = Workbooks.Add
        ThisWorkbook.Sheets(3).Copy Before:=NewWkbk.Sheets(1)
        NewWkbk.SaveAs ThisWorkbook.Path & "\" & Flname & "-" & DateToday


        End If
        WBClose = Flname & "-" & DateToday & ".xlsx"
        Workbooks(WBClose).Close SaveChanges:=False
        
Sheets("Sheet3").Range("A1:BF" & LastRow2).ClearContents




strTo = ""
Sheets("Sheet2").Range("A1:C1").AutoFilter Field:=2, Criteria1:=Crit1
LastRow3 = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row




strTo = Sheets("Sheet2").Cells(LastRow3, 3).Value


'Declare and establish the Object variables for Outlook.
Dim objOutlook As Object
Dim objNameSpace As Object
Dim objInbox As Object
Dim objMailItem As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objInbox = objNameSpace.Folders(1)
Set objMailItem = objOutlook.CreateItem(0)
        


'Display the email message
With objMailItem
.To = strTo
.Subject = temp
.Body = "Blah Blah (enter body text here)"
.Attachments.Add ThisWorkbook.Path & "\" & WBClose
.Display 'Change to .Send if you want to just send it.
End With


'Release object variables from system memory.
Set objOutlook = Nothing
Set objNameSpace = Nothing
Set objInbox = Nothing
Set objMailItem = Nothing


1
Next j


End Sub


Sheet1

*ABCDEFGHIJK
1Department VPSales Repemp IDItemDescriptiontrademarkweek 1week 2week 3week 4week 5
2boss of the bossesJimmy11Cake 11188.07188.07188.07188.07188.07
3boss of the bossesJimmy12Cake 22120.55120.55120.55120.55120.55
4boss of the bossesJimmy12Cake 22120.55120.55120.55120.55120.55
5boss of the bossesTommy23Cake 33111.85111.85111.85111.85111.85
6boss of the bossesTommy24Cake 41124.91124.91124.91124.91124.91
7boss of the bossesRichard35Cake 52195.37195.37195.37195.37195.37
8boss of the bossesRichard36Cake 63173.57173.57173.57173.57173.57

<tbody>
</tbody>

Excel tables to the web - Excel Jeanie Html 4
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

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