View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] deekaye@gmail.com is offline
external usenet poster
 
Posts: 10
Default Apply formula to a range with multiple selections

The code does not work as I gave the wrong details.
Oops, I left out the most important details of my query.
The formula that needs to be applied to the input range is the
following extremely long one.

IF(OR(CELL("format",B2)="D9",(LEN(B2)-LEN(SUBSTITUTE(B2,":","")))=1),--("0"&B2)/60,--("0"&B2))

This needs to be applied to each cell in the input range, where B2 is
for example in the input range.
Selection.Applyformula or Range.Applyformula only works when the
selection in continuous, but when the input range consists of multiple
selections my code does not work as it the output range ends up with
the wrong formula

Sorry for the confusion but any help in getting the correct output
would help.