• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Search results

  1. I

    IF + OFFSET

    Is there any way to make a excel formula that states: Formula in the cell B2: If the value of cell A2 is in the range G2:G21, then the value of cell B2 is equal of the cell in the range H2:H21 (offset -1 column). Ex: A2 = "Ágora Liquidez", then B2 = "Fundo Ágora Liquidez" In cell B2 is the...
  2. I

    Export table from Excel to Word

    I'd like to know how to create a code to export a range in Excel to a Word document that already exists. The issue here is that the Excel range has to be pasted in the end of the Word document. I have a code that pastes it in the begining. Sub createWord() Dim WdObj As Object, fname As...
  3. I

    Formula Array VBA

    Hi, I'm tryng to write a code that uses the outputs of a UDF that's a Formula Array. Function GARCHparams(rets, startParams) GARCHparams = NelderMead("GARCHMLE", rets, startParams) End Function When I record the macro, the code is: Range("O1:O4").Select Selection.FormulaArray = _...
  4. I

    On Error Doubt

    Hi! I´d like to right a code that when error ocuors then it should jump a part of the code and read another (On error GoTo), but when error doesn't ocuors then it shouldn't read that part of error treatment. For i = 2 To uLinha On Error GoTo adicionar procurar =...
  5. I

    Array Doubt

    Hi! I'm trying to right a code that needs a dynamic array. Basically, I'd like to look into all found values (method find) in a current region and store them address in a array. For example, if I find 4 values (then j=4, in my code) in the region that im looking for, then i'd like my array to...
  6. I

    Array Formulas

    Please, I'm tryng to write a dynamic code. I just know how to write it in R1C1 mode, but I'd like to write it as A1 mode. Range("B10").Select Selection.FormulaArray = "=MMULT(MMULT(R7C2:R7C" & nAtivos + 1 & ",Matriz!R2C2:R" & nAtivos + 1 & "C" & nAtivos + 1 & "),TRANSPOSE(R7C2:R7C" &...
  7. I

    VBA - working with array [SOLVED]

    Hi! I'd like to know how can I can write a code that for each "i", I have a value in the variable linha(i). For example, in the column 2 (ie, i=2), the first filled row (ret.Range(Cells(253, i)).End(xlUp).Row) is 10, so linha(2) = 10 ... column 3, first filled row is 5, then linha(3) = 5 ...
  8. I

    Run a macro from VBA

    Hi! I'm trying to write a VBA code to: From workbook_x it opens workbook_y and then run the macros (macro1 and macro2) that are stored in workbook_y. I tryed this: (its written in workbook_x's VBE) ' Workbooks.Open ("U:workbook_y.xlsm") Windows("workbook_y.xlsm").Activate...
  9. I

    UDF - How to define a variable range?

    I'm trying to write a UDF that calculates the slope between 2 variable ranges. But it stucks when I declare the ranges. Whats wrong with this? Function varc(ticker) Dim rang1, rang2 As Range Set cart = Sheets("CARTEIRA") Set ret = Sheets("Retorno") 'ticker =...
  10. I

    Last Row with a especific text

    Hi, I'm trying to determine the last row that has a especific text. I'm sisng the find function, and the code is: Sub orgDebentures() 'Opções Range("k6").Select Do On Error GoTo erro Cells.Find(What:="Debentures", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _...
  11. I

    Comparing Tables

    Hi! I have 2 tables to compare... The table 1 is the newest and the 2 the older. Both have 4 columns (A:D). The logic is to compare each line of the table: - If there is a different line in table 1 compareng with table 2, then set this line blue - If there is a different line in table 2...
  12. I

    RC Style

    Hi, I have a doubt in RC style. What does this means? Range("G4").Select ActiveCell.FormulaR1C1 = "=SUMIF(C3,RC[-1],C2)" Range("H4").Select ActiveCell.FormulaR1C1 = "=COUNTIF(C3,RC[-2])" Thanks!
  13. I

    Dynamic Data Validation

    Hi, I'm trying to make a worksheet of expenses control. The idea is to select a month and the week of this month, and the it will appear a table to complete the expenses in that time. How can I do this? Ex: select month january, and week 1 ... then it will appear the table with the...
  14. I

    Two different loops at same time

    Hi, I'd like to know how can I set up two different kind of loops to running at the same time. I want this: "For each cell in RANGE and For i=1 to 10" (for example) Loop would be: cell(1) and i=1 ; cell(2) and i=2 ... I wrote: For Each cell In FornecedoresG valor =...
  15. I

    Name Range

    Hi, I'd like to know how can I name a range with vba code. When I recorded a macro doing this, i had just the R1C1 way, but I want to know how the regular way is suposed to be. For ex: name "ABC" to the range B1:B11 ActiveWorkbook.Names.Add Name:="ABC", RefersToR1C1:= _...
  16. I

    If Statement + Range Named

    Hi, I'd some help to write a code like this: For i = 1 to LstRow If cells(i,3) = any cell in a named range (ex: D1:D52 is a named range "ColumnD") then 'check if cell (i,3) have the same value as any cell in the range "ColumnD" offset(0,1) "ColumnD" , and send the cell(i,3) to the...
  17. I

    If cell contains ...

    Please, I'd like to write a If statement like this: If cell contains the text "abc" then do that ... But the cell value can be "abc def", "abcdef" etc. The important it to have the word "abc". Thanks
  18. I

    Simple Doubt

    Hi! I'm trying to locate where is the word "ALUGUEL" in column C, and if it finds then write "abc" in column D (same line where "ALUGUEL" is) For i = 1 To LstRow If Cells(i, 3).Value = "ALUGUEL" Then ActiveCell.Offset(0, 1) = "abc" End If Next Could anyone help me? Thanks!
  19. I

    Autofilter and If statement

    Hi! I have one workbook with several worksheets. Each worksheet has a autofilter... i'm interested in one column (G) that has 3 criterias: "n", "e" or "d". Then i'll make a loop into those worksheets, and copy and paste to an other workbook that's has 3 sheets: "n", "e" or "d". The problem...
  20. I

    If Then - ActiveCell

    Hi, Here what i'm trying to do is, if the cell A2 is not empty, then ill go to the last value in the row A, then press F2 (to edit the cell), and delete the last caracter in this cell. Else, if A2 is empty, I press F2 in A1 and delete the last caracter. If Range("A1").Offset(0, 1) <&#62...
  21. I

    Help!

    Hi! Could anyone help me with this problem? I´m trying to run a code, but I don´t know why when I press F8 to check each step of the code lines, it´s jumping the For Next loop step. I´ll write the code here, and if you see any mistake, please tell me, because I can´t! Ps: The idea of the...
  22. I

    VBA Sum procedure

    Hi, I have a data table that is in monthly frequency and i'd like to transform it in a quarter frequency (these data are in sheet1). The data starts in B11 cell ... So i'd like to plot in an other sheet (suppose sheet2): cell A1 = sum(sheet1!b11:d11) cell A2 = sum(sheet1!e11:g11) cell A3...
Back
Top