Excel VBA Rounding -
i trying use following code replace each cell within selected range rounded number of cell within range continue error.
sub add_round() dim rng range each rng in selection rng.value = round(rng.value, -4) next rng end sub
thank you!
i believe need make function yourself, follows (i'm not aware of function in vba works excel's native round function, allows round nearest 1000 etc):
sub add_round() dim rng range each rng in selection rng.value = round(rng.value / 10000, 0) * 10000 next rng end sub
alternatively can tell vba use native excel function this:
sub add_round() dim rng range each rng in selection rng.value = application.worksheetfunction.round(rng.value, - 4) next rng end sub
Comments
Post a Comment