VBS autofill with formulas

oso_togari

New Member
Joined
Sep 1, 2016
Messages
20
Hi all

im pretty sure that i resolved this in the past, but now i cant....(many times my past me is clever than my preset me :( ...bad sign)

anyway:
objExcel.sheets("final").Range("F2").formula2 = objExcel.sheets("final").Range("A2").value&"-"& objExcel.sheets("final").Range("B2").value&"-"& objExcel.sheets("final").Range("C2").value
objExcel.sheets("final").Range("f2").AutoFill objExcel.sheets("final").Range("F2:F" & ultfila+1)

this only copy the valuesand i need the formula ....also if i use .filldown dont works

regards
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
How about
VBA Code:
objExcel.Sheets("final").Range("F2:F" & ultfila + 1).Formula2 = "=a2-b2-c2"
 
Upvote 0
Solution
sorry...

inside formula2 im kile in the excel:

objExcel.sheets("final").Range("F2").formula2 = "=A2&""-""&B2&""-""&C2"
'objExcel.Range("C2","C" & ws.Cells(ws.Rows.Count, 1).End(xlUp).Row -2).FillDown
objExcel.sheets("final").Range("f2").AutoFill objExcel.sheets("final").Range("F2:F" & ultfila+1)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,726
Members
449,093
Latest member
Mnur

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