Excel VBA - Loop through range and set formula in each cell

后端 未结 2 436
萌比男神i
萌比男神i 2021-01-21 08:58

I\'ve got a workbook where I have one worksheet which contains a lot of data. My goal is to create a macro that inserts a formula in a separate sheet to copy the data from the

2条回答
  •  天涯浪人
    2021-01-21 09:36

    Here is a former post of mine containing functions for conversion of column numbers to letters and vice versa:

    VBA Finding the next column based on an input value

    EDIT: to your 1004 error: Try something like this:

      =IF(Numbers1!E" & row & "<>0,Numbers1!A" & row & ","""")"
    

    (use ; instead of ,, and "" for one quotation mark in a basic string, """" for two quotation marks).

提交回复
热议问题