VBA how to create new worksheet and move value

[Solved/Closed]
Report
Posts
2
Registration date
Tuesday March 12, 2013
Status
Member
Last seen
March 13, 2013
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
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 replies

Posts
2
Registration date
Tuesday March 12, 2013
Status
Member
Last seen
March 13, 2013
1
Thanks Trowa, for your advice. But I am looking for VBA code.
1
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2821 users have said thank you to us this month

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
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

Thanks rizvisa.
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
actually your thanks are due to TrowaD. I just copied what he said and added part about macro recorder :)
Posts
2819
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
October 25, 2021
487
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