Thread: Formula Trouble
View Single Post
  #6   Report Post  
JulieD
 
Posts: n/a
Default

Hi JS

here's some code (there's probably a more efficient way to do it, but it
works)

--------
Sub filldates()
Range("R4").Select
Range(ActiveCell, ActiveCell.End(xlDown)).Select
For Each c In Selection
c.Offset(0, 2).Value = Date
Next
End Sub
--------

to use this, right mouse click on a sheet tab, choose view code
from the menu choose insert / module
copy & paste the above into the white piece of paper on the right hand side
of the screen
switch back to your workbook using alt & f11
choose tools / macro / macros - filldates and click on run

hope this does what you're after

Cheers
JulieD

"JS" wrote in message
...
Hi Julie,

The column with data as and when it exists is R and the row starts at 4.
The
column for the date to be displayed is T, again starting at row 4.

Thanks

"JulieD" wrote:

Hi JS

so is the requirement to populate a column with the current date for the
rows with data ---
if so what column do you want the date in
which column ALWAYS contains data if there is any

Cheers
JulieD

"JS" wrote in message
...
Hi Julie,
When I run a query to import data, the query has different amounts of
lines
each time it's run. Also within the sheet, I have todays date which I
need
to
be on each line but only when data exists. So far simple, but when I
then
do
a mail merge, any cell with a formula is converted to a letter, which I
don't
want.

JS

"JulieD" wrote:

Hi JS

a formula can not act on any cell other than the one it's in -
however,
code
can - is a code solution acceptable to you?
if so what are the specific requirements

Cheers
JulieD



"JS" wrote in message
...
I would like data to be displayed in a different cell.
e.g. formula would be in a cell in sheet2, but saying something
like,
if
sheet1 A10, then print the data from sheet1 C1 into sheet1 D1.

Reason behind using sheet 2 for the formula, is that when i use the
formula
in sheet 1 and copy down, the query I'm using for mail merge looks
at
the
formula data and thinks it is relevant data for importing.
Hope this makes sense to someone.
Thanks
JS