Forum Discussion
Need VBA code to get the data from another excel and use few formula, write the output back to excel
- Jul 01, 2021
I did what you asked, but I already suspected that it wasn't what you wanted.
Remove the lines
' Optional ws2.Range("A2:A" & lr).Value = .Value
from the code.
Please attach two sample workbooks.
HansVogelaar , Please find the sample workbook 1 in the attachment and the 2nd workbook which is an empty workbook. In that need to write a VBA, then put it into button. The function is whenever we click the button in the excel workbook 2 , it will get the column A data from Workbook 1 and process the formula that you have shared previously, then write the data back output to Workbook 1 in Column B.
Thanks for your help on this.
- HansVogelaarJul 01, 2021MVP
See workbook2 (now a macro-enabled workbook)
- Santhosh_VJul 01, 2021Copper Contributor
HansVogelaar Thank you so much for your Prompt help on this scenario.
After I clicked the button its working but the same output is pasted in the workbook2 as well like the below screenshot.
Is there any way to get rid of them.
- HansVogelaarJul 01, 2021MVP
I did what you asked, but I already suspected that it wasn't what you wanted.
Remove the lines
' Optional ws2.Range("A2:A" & lr).Value = .Value
from the code.