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

Does VBA macros have a max number of cells?

Gungnir5

New Member
I just used the Macro recorder and created this "Fill_Blanks" code. I have a column w many blanks. I want to fill in all the blanks by referring to the last non-blank cell above. (I tried the GoTo Special Blanks =cellref CTRL+ENTER trick, but the range was too big) I was wondering if I am running into the same problem w my macro. It just takes the last non-blank cell and pastes it all the way down :(


If so how can I automate the range selection to make this macro work? where should I put the offset line?


hxxps://www.box.com/s/9q5zux47cz9oljaercrf


Here's the xlsm file. I just had to reinstall everything on my system bc I screwed something up in my registry so I promise it's malware/virus free!


All help appreciated!!


Sub Fill_Blanks()


Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select

Selection.SpecialCells(xlCellTypeBlanks).Select

Selection.FormulaR1C1 = "=R[-1]C"

ActiveCell.SpecialCells(xlLastCell).Select


End Sub
 
Maybe I was thinking too hard...this works well and doesn't require vba :p

= if(A3="",B2,A3)

Put that into an empty column. Problem solved!!
 
Back
Top