.formula

  1. 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)...
  2. 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...
  3. 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...
  4. 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"...
  5. 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...
  6. 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)"
  7. 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...
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. 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(...)...
  13. 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...
  14. 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...
  15. 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...
  16. 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...
  17. 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...
  18. 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...
  19. 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)...
  20. C

    Strange VBA problem with Cells.Formula: evaluation results in error

    Dear all, Can somebody tell me why .Cells(592 + gameno + 32 * opponent, 22 + Hometeam).Formula = "= " & .Cells(592 + gameno + 32 * opponent, 22 + Hometeam).Formula & " + " & .Cells(646 + daysconcerned, 18).Value results in an error? The error code is 1004: error defined by application or...

Watch MrExcel Video

This Week's Hot Topics

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
Top