.formula

  1. M

    Using VBA .Formula to add a formula typed into an excel cell

    Hello, Sorry in advance if I'm not using the correct terminology but hopefully I can explain it well enough. This is for some code I am still writing so don't have a complete code to post but I have copied what I think are the relevant bits. I'm trying to get a formula added to a range by...
  2. NewOrderFac33

    Search and Replace custom function issue

    Good morning, I'm trying to write a function to search and replace, thus: Set AnimalColumn = Sheets("Database").Range("Col_AnimalType") ReplaceWithSpecies AnimalColumn Function ReplaceWithSpecies(RangeToProcess As Range) With RangeToProcess Select Case UCase(.Formula)...
  3. P

    Copied data to another sheet how to change values of rows

    Hi, good afternoon. I have got the code below where I copy data from one sheet to another but in row B the data in this is 13 numbers but it comes up as +23555 for example how can I change the value to this to show as the 13 digit number? also in Row Q is the date as 15/05/2019 but when copied...
  4. P

    copying from one sheet to another

    Hi Please can you help, I have the code below where for example in cell BK1 I have the word "ETA" and I want to copy this over in A@ and down to last row. and then I want to copy the data from "FMUI" sheet into "New" sheet, but I keep get errors. please can you help. [/CODE]Private Sub...
  5. P

    amend value when copied to show full numbers when pasted into new cells

    Hi I have the code below where I copy data from Range AL2 to paste into B2 but the numbers look like 2.7Ex12 and I want this to show as 2700444444444 for example how can I amend that in the code? it is the first line below Private Sub CommandButton2_Click() Range("AL2"...
  6. C

    Vlookup

    Hi, I am trying to execute following code, this code matches first 10 characters of two columns and if it matches then it copy and paste it in the workbook. /code .Formula = "=VLookup(LEFT(A2,5),'C:\Users\ofatima\Documents\Ivy Woo\[dump_parts_IWoo New.9175.xls]Sheet1'!$A: /code it is...
  7. W

    How to create a function that converts formulas to .formula?

    Hi, I am trying to convert formulas to .formula in VBA. However, I found it hard sometimes. Is it possible to convert a subroutine that creates .formula from formulas? An easy example would be: =SUM(A2:A5) get converted to .Formula = "=SUM(A2:A5)"
  8. P

    Run time error '91'

    Hi i have the code below but i keep getting a runtime error 91 object variable or with block variable not set, please can you hellp with this it highlights in yellow when i click on debug the .Formula = TheFormula code which is below in the whole code, any advise would be great and thanks...
  9. L

    Need Help With the VBA .Formula Property With Variable

    Guys/Gals, I am trying to have the below code place a formula in Cells(lRow, 3) that contains variables. However, every time i try this it shows a #Name ? error. I have searched on this forum for additional help, but i can't get their solutions to work in my code. Can someone please show me the...
  10. N

    Why am I getting an object required error?

    Working on a script and this line of code keeps coming up with an object required error : .AutoFill Destination:=.Range("AT2:AT" & lastrow) I also have it labeled towards the bottom of the script, can anyone help out? Sub Update() 'File...
  11. J

    Printing a variable's value into a cell using vba

    Hello guys, I want to use VBA to assign the variable formula b into some cells inside a for loop. If I use .formula = "b" instead of .formula = b, i get the string "b" in the correct places. How do I get VBA to write b's value into those cells? What is the correct syntax? Should the &s be +s...
  12. C

    Macro to link cells

    Something's not right and I expect the x and y won't change in the quotations. Any ideas? Sub linkMergedCells() Dim x As Integer Dim n As Integer n = 3 x = 6 Do While x > 0 For y = 1 To 6 Worksheets("Sheet1").Cells ("A" & n) .Formula = "=Sheet3!(x,y)" n = n + 2...
  13. P

    Putting a formula to a picture

    Hi All. Excel 2007 / WinXP I wish to apply a formula to an inserted picture. The formula would be a named range, say .formula = "=NamedR". This should be done all through VBA. A large number of workbooks need to be processed. To insert the picture I used the usual .Picture.Insert(...)...
  14. M

    copying a formula from one workbook to another. Lost the will to live

    Evening peeps, I have been trying to figure out what is wrong with my code for the past 4 weeks and have got no closer to fixing it. basically the workbook that i have created is a way of me keeping track of the time that I work but from time to time I tweak the master workbook and then use a...
  15. S

    .Formula = "=IF(..." Application-defined or object-defined error

    Hello, I am receiving the Run-time error '1004': Application-defined or object-defined error for the below. As you can see from the sample code, there is a bit right before which has a similar set-up and it works fine. I believe it is a syntax error of some sort (like missing quotes, or an extra...
  16. T

    Runtime error 1004 when using .Formula

    Hi - I'm trying to insert a formula using vba, which I thought would be fairly simple. The code I have used is: Range("H573").Formula = "=IFERROR(IF(SUMIF(C_datadump!$B$23884:$B$24191,I_control!$F573,C_datadump!BG$23884:BG$24191)=1,1,0),"")" However I am receiving runtime error 1004. I've...
  17. B

    .Formula with cells from different sheets

    Hello Everyone and once again thank you for all your help. I am trying to use activecell.formula however a few of the cells I need referenced are from different sheets then the one I am currently in and when I used cell.address it puts the address in but for the sheet I am working in. Here is...
  18. U

    [VBA] .formula = "=" & variable - Error 1004

    Hello, I'm trying to use the .formula function in VBA but I don't know how to use it with a variable following the "=" character... Here's my code: Dim sheetlist As String Dim i As Integer i = 2 While Range("B" & i).Value <> "" sheetlist = Range("B" & i).Value Range("C" & i).Formula...
  19. P

    creating automated income statement, want to add dynamic monthly column to AVERAGE and SUM

    Hi VBA masters, I'm creating an automated daily income statement with currency rates, cash balances, expenses, etc. I would like to add a monthly column that's dynamic and uses VBA's ".Formula" tool to add functions and perform calculations on the daily values. I'm having trouble using the...
  20. C

    VBA: .Formula = "=" Cells.Value with a lot fo decimals

    Hello all, This is a follow-up on a previous question (http://www.mrexcel.com/forum/showthread.php?p=2935323#post2935323), as I just now found out what seems to be causing the problem, I prefer to post it in a specific thread. I have a formula which simplified (without loops and variables)...

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