Write a macro to change a decimal degrees (e.g. 245.678) to degrees, minutes, seconds (e.g. 245° 40' 40.8"). Input and output using message boxes and round the seconds value to one digit to the right of the decimal. Validate with a block of statements the input data to assure that the input is not less than zero or greater than 360 degrees. Place a "RUN" button on the spreadsheet.

Respuesta :

CPED

Answer:

All the procedure is explained below step-by-step

  1. Press alt+F11 to open VBA in excel.
  2. Create a module and start entering the subroutine.
  3. The coding of subroutine is attached in the image.

For adding "RUN" button:

  1. Select a shape on the sheet for the button.(Insert > Shapes > Rectangle).
  2. Double click on the shape to add text and write "RUN".
  3. The button can be styled by adding colors and shadows.
  4. Now Assign macro to the button (Right click  > Assign macro).
  5. A window pane will appear, select the macro from This workbook list so that it may work properly when shared with others.
  6. Press OK.
  7. "RUN" button has been created and by pressing it the subroutine will work as required.

Ver imagen CPED
Ver imagen CPED
Ver imagen CPED