Question : excel - macro for option button

Hi,

I have created option button in excel by going to tools-> forms.

Now in the macro, I need to write the code to verify which option button is selected and the assign a value to a variable.
But the code I have written is not working and the variable dsource is not being assigned any value.

Can someone suggest a solution for this?

I have written something like this

If ActiveSheet.Shapes("Option Button 11").Select Then

dsource = "CALQA.WORLD"
ElseIf ActiveSheet.Shapes("Option Button 12").Select Then
dsource = "CALDEV.WORLD"
         End If

Answer : excel - macro for option button

Hi guyneo,

Here is an example of how to parse the xml you supplied and format the date to your format.

I removed the gmt offset from the output, let me know if you want to include it or not.


Code will produce this output:
----------------------------------------
departure: Apr 11 2006 04:28pm
arrival: Apr 11 2006 05:40pm



1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
<?php

$xml = '<responseLeg>
<airline airlineCode="US" airlineName="US Airways" />
<flightNumber>6974</flightNumber>
<equipments>Airbus Industrie A318/A319/320/321</equipments>
<departure date="2006-04-11-08:00" location="LAX" time="16:28:00-08:00" />
<arrival date="2006-04-11-08:00" location="LAS" time="17:40:00-08:00" />
<cabinType>Economy</cabinType>
</responseLeg>';

$xml_array = simplexml_load_string($xml);

foreach($xml_array->departure as $departures){
	echo "departure: " . date('M d Y h:ia',strtotime(substr($departures['date'],0,10) . ' ' . substr($departures['time'],0,8))) . '<br />';
}

foreach($xml_array->arrival as $arrival){
	echo "arrival: " . date('M d Y h:ia',strtotime(substr($arrival['date'],0,10) . ' ' .  substr($arrival['time'],0,8))) . '<br />';
}

?>
Random Solutions  
 
programming4us programming4us