Add Formula, fill the row and display the values

Chefsohail

Board Regular
Joined
Oct 3, 2020
Messages
90
Office Version
  1. 365
Platform
  1. Windows
HI Team,

Please help me with the below vba code. I am able to achieve the following - 1. Add formula to the cell and 2. Fill Formula down... What i achieved is that the formula is filled down as required. But i do not want the formula here. I want its corresponding value to appear. Please help

VBA Code:
wsDS.Range("B2").Formula = "=LEFT(A2,8)": wsDS.Range("B2:B" & wsDS.UsedRange.Rows.Count).FillDown
 
Just replace this
VBA Code:
wsDS.Range("B2").Formula = "=LEFT(A2,8)": wsDS.Range("B2:B" & wsDS.UsedRange.Rows.Count).FillDown
with the code I provided.
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Ok @Fluff

I'll try that..

And for the rest ....

VBA Code:
wsDS.Range("D2").Formula = "=RIGHT(C2,5)": wsDS.Range("D2:D" & wsDS.UsedRange.Rows.Count).FillDown
wsDS.Range("E2").Formula = "=VLOOKUP(D2,'UOM Comm'!D:R,2,0)": wsDS.Range("E2:E" & wsDS.UsedRange.Rows.Count).FillDown
wsDS.Range("F2").Formula = "=VLOOKUP(D2,'UOM Comm'!D:R,7,0)": wsDS.Range("F2:F" & wsDS.UsedRange.Rows.Count).FillDown
wsDS.Range("R2").Formula = "=IF(M2="""",""Failure"", IF(LEFT(J2,1)=CHAR(41),""Na"",""Auto Approve""))": wsDS.Range("R2:R" & wsDS.UsedRange.Rows.Count).FillDown

I'm not sure what all to change here...I understand the range...
But not sure about the formulae and if offset number will change.
 
Upvote 0
Hi @Fluff ,

The code that you gave worked. Thanx. If you can please help for others as well...Im trying my best to work it out...
 
Upvote 0
ill need your help with the others @Fluff....and The range D2:D i need the answer in text because there are values starting with 00XXX and they are looked up in the next codes.

I tried multiple combinations. The problem is that I dont understand that code....im still trying.

Sorry for being a pain.
 
Upvote 0
Please start a new thread for these other formulae as it's now a different question.
Also please remember that not all members are in the same time as yourself & be patient.
 
Upvote 0

Forum statistics

Threads
1,215,528
Messages
6,125,338
Members
449,218
Latest member
Excel Master

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