enter today's date + text

srikanthg2310

New Member
Joined
Nov 9, 2015
Messages
17
I need a macro which will enter " today's date + text" . when i press alt + enter and run the macro again in a single cell it should again insert the same. please help. thank you.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
so whichever cell is highlighted you want to replace the contents with "today's date and text"
OR
with say 21/11/2015 text
 
Upvote 0
not sure I understand what you want - just put the current date followed by "abcd" in the highlighted cell ?
 
Upvote 0
Try this;
Code:
Sub Date_Text()
    ActiveCell.Value = Format(Now(), "d/mm/yyyy") & " ABCD"
End Sub

You can then assign your keyboard shortcut to the macro. However, it is usually Cntrl + a character
But Alt + F8 will show you the macro list, then you can press Run
 
Upvote 0
thank you.. but i have one more question. after i run the macro in a given cell and then i hit alt+enter it goes to a new line in the same cell.
I want to run the macro again in the same cell in the next line but it is not working. please help.
 
Upvote 0
Code:
Sub Date_Text()
With ActiveCell
  .Value = Format(Now(), "d/mm/yyyy") & " ABCD" & Chr(10) & .Value
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,040
Messages
6,122,806
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top