Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Macro code to reference a cell for a date parameter when pulling data
I have this code:
& "AND (matter.mmatter Like '" & Sheets("Parameters").Range("C17").Value & "')" & Chr(13) & "" & Chr(10) & "AND (timecard.ttk Like '" & Sheets("Parameters").Range("C19").Value & "')" & Chr(13) & "" & Chr(10) & "AND (timecard.tworkdt={ts '2012-01-01 00:00:00'}) " & Chr(13) & "" & Chr(10) & "AND (timecard.tworkdt<={ts '2012-01-31" _ , " 00:00:00'})") It works fine, but I want the date part: "AND (timecard.tworkdt={ts '2012-01-01 00:00:00'}) " to reference a cell in the worksheer (ie D5) instead of been fixed. ANy help will be appreciated. Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro code to reference a cell for a date parameter when pulling data
JAlvarez wrote:
I have this code: & "AND (matter.mmatter Like '" & Sheets("Parameters").Range("C17").Value & "')" & Chr(13) & "" & Chr(10) & "AND (timecard.ttk Like '" & Sheets("Parameters").Range("C19").Value & "')" & Chr(13) & "" & Chr(10) & "AND (timecard.tworkdt={ts '2012-01-01 00:00:00'}) " & Chr(13) & "" & Chr(10) & "AND (timecard.tworkdt<={ts '2012-01-31" _ , " 00:00:00'})") It works fine, but I want the date part: "AND (timecard.tworkdt={ts '2012-01-01 00:00:00'}) " to reference a cell in the worksheer (ie D5) instead of been fixed. ANy help will be appreciated. Try something like this: "AND (timecard.tworkdt=" & Range("D5").Value or: "AND (timecard.tworkdt=" & Cells(5, 4).Value -- I have come here to chew memory and kick ass... and malloc() is returning a null pointer. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Get cell reference as parameter in function | Excel Programming | |||
How 2 Link DATA instead of CELL REFERENCE - Pulling My Hair Out! | New Users to Excel | |||
help with passing date to access as parameter query(code included) | Excel Programming | |||
Excel, reference a cell for parameter in SQL to import data | Excel Programming | |||
Data_field parameter in getpivotdtata as a cell reference. | Excel Discussion (Misc queries) |