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

Create new column with date function

Vijayarc

Member
Hi Team

please help me on attached excel , I want macro to add today date on next empty column
on 3 rows when I click button .
 

Attachments

  • sample1.xlsm.xlsx
    16.7 KB · Views: 3
Hi,
Try:
Code:
Sub belle()
Dim ws As Worksheet
Dim rng1 As Range, rng2 As Range, rng3 As Range
Set ws = Sheets("Sheet1")
    Set rng1 = ws.Rows(2).Find("*", ws.[a2], xlFormulas, , xlByColumns, xlPrevious)
    Set rng2 = ws.Rows(10).Find("*", ws.[a10], xlFormulas, , xlByColumns, xlPrevious)
    Set rng3 = ws.Rows(18).Find("*", ws.[a18], xlFormulas, , xlByColumns, xlPrevious)
        rng1.Offset(, 1) = Date
        rng2.Offset(, 1) = Date
        rng3.Offset(, 1) = Date
End Sub
example attached
 

Attachments

  • Vijayarc.xlsm
    25.2 KB · Views: 2
Hi Belleke
one more help on same excel
as per your above code my columns are dynamic, adding one column daily
i want that the dynamic data want to save to next sheet on fixed cell
for example: dynamic cell value :BE3 should save on sheet2 on B2 static cell
:BE4 cell should save on sheet2 on B3 static cell

.
pleas help on this issue belleke
 
Back
Top