Results 1 to 9 of 9

Thread: [Resolved] Applying a formula to a highlighted region

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    4

    [Resolved] Applying a formula to a highlighted region

    I hope this makes sense. I'd like to write code to apply the round function to each cell in a user selected region. For example if i highlight with my mouse from A1 to C3 i want all of those cells to be rounded. I found some code in here that uses hard coded values for the region, but that's not exactly what i'm looking for.

    I thought i could do it like this:

    Dim CellValue As Double

    For Each c In ActiveSheet.CurrentRegion.Cells
    CellValue = ActiveCell.Value
    ActiveCell.Value = Round(CellValue, 0)
    Next

    But it only rounds the first Cell in the region.

    Thanks
    Last edited by PhalSe; Apr 8th, 2004 at 05:35 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width