Merge functions and application

Hernan_g_f

New Member
Joined
Jul 26, 2022
Messages
25
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I'm writing a macro but I have a trouble

The macro is:

Sub a()

Dim Fecha As Variant
Dim Rango As Variant
Set Rango = Sheets("1").Range("E16:DC1400")


lastrow = Sheets("1").Range("E" & Rows.Count).End(xlUp).Row


For cont = 17 To lastrow

Fecha = Sheets("1").Cells(cont, 114)

O = Application.VLookup(Fecha, Rango, 3, False)


If IsError(O) Then
O = 0
End If

Sheets("1").Cells(cont, 115) = O
Next cont


I need to add a product function, to the "O" equation with a constant

O = ¿? product(consant, application.Vlookup(Fecha, Rango, 3, False)

How can I write it?

Thank you very much for your help!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Welcome to the Board!

Are you just trying to multiply by a single value?
If so, then you do not need the "Product" function.
Just use something like:
VBA Code:
Sheets("1").Cells(cont, 115) = O * constant
(Note: That I applied to the place where you are placing the value back on the sheet, as you do not want to try to multiply your errored value by a constant).
 
Upvote 0
Solution

Forum statistics

Threads
1,225,754
Messages
6,186,827
Members
453,377
Latest member
JoyousOne

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