View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] adambush4242@hotmail.com is offline
external usenet poster
 
Posts: 168
Default If Then VBA statement

Thanks a lot for your help guys

"PCLIVE" wrote:

If you wanted to use formulas, you could use this in C6 and just copy it
over and down.
=IF(M6="","",IF(M$5=TRUE,M6,""))

Through VBA, here's one way assuming your True/False values are in row 5:

For Each cell In Range("M5:Q5")
If cell.Value = True Then Range(cell.Offset(1, -10),
cell.Offset(19, -10)).Value = _
Range(cell.Offset(1, 0), cell.Offset(19, 0)).Value
Next cell

HTH,
Paul

"
m wrote in message
...
I have a data set, 5 columns by 18 rows, M6:Q24. At the top of each row is
a
True-False statement. I want to create a function that looks at each
column,
and if the true-false statment says true will paste special the values
into
columns C:G, respectively, in the same rows. If the statment says false,
the
function will do nothing. Any ideas?

Thanks

Adam Bush