Hi all,
I am using the below to fill formula in specific column:
How can i refer to last used column and fill formula?![]()
Range("B2:B" & Cells(Rows.Count, "A").End(xlUp).Row).Formula = "=1"
Thanks a lot!
Hi all,
I am using the below to fill formula in specific column:
How can i refer to last used column and fill formula?![]()
Range("B2:B" & Cells(Rows.Count, "A").End(xlUp).Row).Formula = "=1"
Thanks a lot!
Are you want to fill out column B starting from B2 until the last used cells in column A right?
try both of these;
![]()
Range(Range("B2"), Cells(Rows.Count, "A").End(xlUp).Offset(, 1)).Value = 1 Range("B2:B" & Cells(Rows.Count, "A").End(xlUp).Offset(, 1).Row).Value = 1
Last edited by Faridwahidi; 05-25-2016 at 05:35 AM.
1. Thank those who have helped you by clicking the Star * below the post.
2. Please mark your post [SOLVED] if it has been answered satisfactorily.
Sincerely,
Farid
Hi,
Thanks for a reply.
I want to fill not in the column B but in the last used column.
Cheers
It would be easier to understand if you would upload a sample spreadsheet but in my understanding try below code and see if that what you are looking for.
Hope That helped![]()
Sub LastRow () dim lr as long lr = activesheet.range("B" & Rows.count).end(xlUp).row activesheet.cells(lr + 1, "B").value = [Define your formula here or "1" if it is going to be number 1] End Sub
Hi,
I am looking for the code which would fill the first empty column with formula till the last used row in column A
For example: A column filled, B filled, C filled. Macro needs then to find D and fill dawn the formula according last used row in column A.
Please let me know if spreadsheet is needed then i will upload it in the evening!
Thanks
Great, it works!
Just one small issue - the formula somehow becomes not dynamic, e.g. =A1+B1 not changing to A2+B2 fpr second row![]()
Figured that out myself!!!! Thanks again all for help!
You're welcome. if you don't mind mark your post as solved so others with same problem can used it too
Hey,
I still have a problem...;/
When I am using formulas with RC then it works well. Any idea why it's not working when I directly pointing to cell like A12. It fills only to A12 and not changing to A13, A14 for the next lines?
Perfect, thanks a lot! Marking posted as closed![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks