Merge functions and application

Hernan_g_f

New Member
Joined
Jul 26, 2022
Messages
22
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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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