ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   How to put VBA formula in Excel Sheet (https://www.excelbanter.com/new-users-excel/164352-how-put-vba-formula-excel-sheet.html)

EricBB

How to put VBA formula in Excel Sheet
 
hi there,
how can i fix the error for this VBA?
Sub PutDate()
Range("A1") = "="Date :" & TEXT(TODAY(),"dd-mm-yy")"
End Sub
pls. help me for this. thanks in advance.
EricBB

JE McGimpsey

How to put VBA formula in Excel Sheet
 
One way:

Public Sub PutDate()
Range("A1").Formula = "=""Date :"" & TEXT(TODAY(),""dd-mm-yy"")"
End Sub

Note that quotes within the formula string must be doubled.

In article ,
EricBB wrote:

hi there,
how can i fix the error for this VBA?
Sub PutDate()
Range("A1") = "="Date :" & TEXT(TODAY(),"dd-mm-yy")"
End Sub
pls. help me for this. thanks in advance.
EricBB



All times are GMT +1. The time now is 04:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com