Make a macro look up specific cell
I have this macro code...How do I change the macro from looking up the whole column to a specific cell.
For Rw = 2 To LastRw
tSht.Copy After:=Worksheets(Worksheets.Count) 'copy the template
With ActiveSheet 'fill out the form
'edit these rows to fill out your form, add more as needed
.Range("B13").Value = dSht.Range("B" & Rw).Value
.Range("G13").Value = dSht.Range("C" & Rw).Value
.Range("D42").Value = dSht.Range("E" & Rw).Value
.Range("D50").Value = Format(Date, "yyyy-mm-dd") <---------I would like to change the date to look up a specific cell like "B2" (I forget the coding)
Solutions to the Problem Make a macro look up specific cell
I think you are talking about something like this,
.Range("D50").Value = Format(.Range("B2").Value, "yyyy-mm-dd")
I don;t understand why you are converting the date to a textual representation of a date.
You could just pass the value of B2 along into D50 and use .Range("D50").NumberFormat = "yyyy-mm-dd" to achieve the visual result.
The number formatting will survive
any export to CSV if that is a worry.
Another Safe way to Fix the problem: Make a macro look up specific cell:Click here to download the registry repair application .
How to Fix Make a macro look up specific cell with SmartPCFixer?
1. You can Download SmartPCFixer here. Install it on your system. When you open SmartPCFixer, it will perform a scan.
2. After the scan is done, you can see the errors and problems need to be repaired. Click Fix All.
3. When the Fixing part is done, your computer has been speeded up and the errors have been fixed
Read More: [Solution] Window Authentacation , could not connect to serv,How to Resolve - error code: err.avg.pop3 proxy server canno,How to Fix - I was defragmenting my computer like I always do.?,Unable to down load kodak all in one printer 2150 disc,Solution to Error: Task Scheduler won't display "All running,windows defender and windows security service center,Returning a column string when the max/min is found in a corresponding column.,Windows Media Player not showing album art,office 2007 files opens as zip file,taskbar has wrong icons