1. S

    Excel VBA FormulaR1C1 Error 1004

    Hi, I am getting 1004 error for the following code, i have checked through many time and still unsure why.. ActiveCell.FormulaR1C1 = "=IF(" & buffer2(0) & "=""yes"",IF(" & buffer2(1) & "=0," _ & buffer2(2) & "*0.07,SUMPRODUCT(" & buffer2(1) & "," & buffer2(3) & ") * 0.07),0)"
  2. S

    Macro For...Next Loop - use counter in FormulaR1C1

    I am trying load Picking Sheets with data from another sheet. I cannot workout the syntax to access the data. Receiving Compile error - Syntax. how do I access the other sheet? Sub Macro4() ' ' Macro4 Macro ' ' Dim OrderCount As Integer For OrderCount = 0 To 600 ActiveCell.Offset(0...
  3. A

    FormulaR1C1 not working when using UserInterFaceOnly:=True

    Hi I am trying to run some macros in a protected sheet. I believe using the UserInterFaceOnly:=True method will allow this and i have it in my Workbook_Open macro. But a simple operation of copying a relative formula does not work. Setup code: Private Sub Workbook_Open() Dim ws As Worksheet...
  4. A

    FormulaR1C1 + reference problem

    Hi guys! :) So, I've got this piece of code, which is working: ws.Range("A$" & rowCount & ":" & "AX1").FormulaR1C1 = "=[lol.xlsx]korr!RC" It simply copies A1 from one file to A1 of the other file, but with explicitly referencing the path (which is exactly what I need). However, as I have to...
  5. J

    Write a Jagged array containing value and FormulaR1C1 to excel.

    I have a jagged array containing normal values and formulas in R1C1 notation and I want to write it into excel. I used following code for the same dataRange.Value2 = jaggedArray; But it produced unexpected results in case of column anchored formulas like '=$A1'. I got it fixed by rewriting...
  6. H

    VBA - Sheet name variable for property .FormulaR1C1

    Hi, How can I insert a variable for the sheet name. Example: I want sum cells A1:B10 in sheet1i=1 Range("A1").FormulaR1C1 = " =sum('sheet & i & '!R1C1:R10C2)" --> I know this is the wrong way to do it... Thanks in advance! Hurkk
  7. E

    How can I easily blend text and formulas with FormulaR1C1?

    Hello How can I easily blend text and formulas with FormulaR1C1? Ideally I don't want to have to double quote everything or escape numerous characters etc. Is there a neat way? Thanks
  8. A

    Inserting Time and Sumif Formulas with VBA

    Hi all, I have a legacy macro that is used to read data from an excel file to a linked file to get info in to an Access database. The source files are protected, and I don't know where to find the passwords, but I need to get more of the information out of the source file and in to my database...
  9. J

    variables in .formula vs .formular1c1

    Trying to sub a variable into vlookup for the table array. This works: Sub vl() ' temporary fix for summer teach Dim vl1 As Range Dim vl2 As Range Dim vl1a As Range Set vl1 = Range("A:A").Find("C.I.") Set vl2 = Range("B:B").Find("17200") Set vl1a = Range(vl1, vl2) MsgBox...
  10. M

    VBA FormulaR1C1 function errors array formula in cells of another workbook

    Has anyone seen this and knows what's causing it and/or has a cure or workaround? I have a workbook that pops up a user form that base on the selection will update the associated workbook sheets. I have another workbook open at the same time that has several array formula in table that refer to...
  11. M

    How to reference an active table in a FormulaR1C1

    I have a workbook that has multiple tables on each worksheet. Here is the formula that I have: Sub Test() Const WHAT_TO_FIND As String = "Application" Dim ws As Excel.Worksheet Dim FoundCell As Excel.Range Dim myTable As ListObject Set ws = ActiveSheet Set FoundCell =...
  12. C

    Use FormulaR1C1 to populate formula if cell contains specified value

    Hello, I need help with inserting a multiplication formula that is using two cell values in the formula IF another cell contains a specific value. If cell G1 = "1", then I want to insert a formula in cell H1 as follows G1*D1, and so on throughout the table of data. The table of data will...
  13. G

    Help entering R1C1 formula using VBA

    Using Excel 2007 and VBA. I need to enter formulas into multiple cells of a worksheet referencing cells on another worksheet in the same workbook. The cells in the source worksheet are not contiguous, so copy/paste an existing formula on the destination worksheet will not work. I recorded a...
  14. S

    FormulaR1C1 in combination with constants

    Hi all, I have a rather simple code where I want to split a row in two (say a bill). Some of the cells will contain the same information (e.g. date), which is just copied from the row I am splitting. When the row is split, I want some cells in the new row to be the residuals of the total amount...
  15. C

    Using a single variable in a FormulaR1C1

    This is a simplification of my problem. A1 has a number and B1 is selected. When I run this code it results in an error, why? Sub test() Dim x As Single x = 0.5 ActiveCell.FormulaR1C1 = "=RC[-1]*" & x End Sub
  16. C

    Use a Range variable in FormulaR1C1

    Why does the following code results in a error? (The code is a simplified version of my code, in reality I want a much bigger formula.) Sub test() Dim a As Range Set a = Selection Range("A1").Select ActiveCell.FormulaR1C1 = "=MAX(" & a & ")" End Sub
  17. R


    I have read many discussions on how to CONCATENATE or not to. Using public functions or entering the data in active cell. Right now I want it to select range D2 and combine all data in column D (not including blanks or duplicates) into Cell D2 with a delimiter (/) Range("D2").Select...
  18. P

    VBA Macro, copy and paste between cells

    I'm trying to copy a value and paste it using R1C1 function. Most of my macro looks like this (which works): Range("A2").Select ActiveCell.FormulaR1C1 = "=IF(R[-1]C[-10]=""value"",R[1]C[1],"""")" The above pattern is getting all of the values that I want into appropriate columns. Where I'm...
  19. E

    Formula with relative references without selecting cell

    Hi, I'm trying to use VBA to put a formula in a cell which will average the values in the last 6 columns. The following works OK: TableSheet.Cells(WorkingRow, LastColumn + 1).Select ActiveCell.FormulaR1C1 = "=AVERAGE(RC[-6]:RC[-1])" (WorkingRow and LastColumn are integers) but I'd like to...
  20. S

    Hardcoding works but Variable doesnt in SUMIF

    This looks like a fairly stupid question to ask and i've tried my way around the forum but couldn't find an answer that worked for me. I am passing using FormulaR1C1 with a SUMIF. When I pass a hardcoded value into the Criteria, it seems to be working fine. But when I try to pass a variable...

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
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 "".
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