VBA how to create new worksheet and move value

Solved/Closed
yogi_himalayan Posts 2 Registration date Tuesday March 12, 2013 Status Member Last seen March 13, 2013 - Mar 12, 2013 at 05:30 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 17, 2013 at 07:55 AM
Hello there,

I am zero in vba, can anyone please assist me what code to be used given following conditon

Given,(I have data converted from csv to xls as follows)
1. I have alphabetical data in column 'I'
2. Numeric data on column 'L' and 'm'

Output I want

1. create new worksheet in same workbook and name it 'Recs'
2. Move only value from column 'I' to column 'A' of 'Recs'
3. Move numeric data of ''L' and 'M' (value only) to column 'B' of 'Recs' But it should be moved meeting condition =if(L1>=0,-L1,M1)
4. create a message box named 'send email' so if I click on that message box, only worksheet 'Recs'get attached to my 'new email' of outlook express

Hope the the way I have defined above makes sense and not too demanding, :-). Please let me know if any further detail would be helpful.

Thanks in advance for your assistance.




2 responses

yogi_himalayan Posts 2 Registration date Tuesday March 12, 2013 Status Member Last seen March 13, 2013 1
Mar 13, 2013 at 12:02 AM
Thanks Trowa, for your advice. But I am looking for VBA code.
1
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Mar 16, 2013 at 12:18 PM
Yogi
Do this
1. Start excel
2. Start macro recorder
3. open you CSV file
4. Sort column I to get all data together
5. Create a new worksheet and rename it 'RECS'
6. Copy from your sorted sheet paste it to Recs sheet.
7. Place the formula in column B of Recs sheet. Just put the sheet name with an ! before the cell references as in Sheet1!L1.
8 Stop macro recorder.

This gives you a good template of what you are trying to do. Paste your resulting macro here
0
yogi_himalayan
Mar 16, 2013 at 07:47 PM
Thanks rizvisa.
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Mar 17, 2013 at 07:55 AM
actually your thanks are due to TrowaD. I just copied what he said and added part about macro recorder :)
0
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 555
Mar 12, 2013 at 12:16 PM
Hi Yogi,

1. do this manually.
2. Sort column I to get all data together, now cut/paste it to Recs sheet.
3. Place the formula in column B of Recs sheet. Just put the sheet name with an ! before the cell references as in Sheet1!L1.
4. I have no idea how to create email using excel. Sorry

Best regards,
Trowa
0