ranges vs. entire worksheet

F

Frank Murray

Hello

I'm looking to solve a problem with selecting a specific range or ranges as opposed to an entire worksheet. I'm formatting numbers to the nearest 1/2 decimal place, but only for a specific range, i.e., D1:F1, etc. I've tried a With.... End With statement as well as For...Next loops, but I think at this point I'm barking up the wrong tree with that kind of logic

Any assistance/information is appreciated. Thanks in advance

fjm
 
F

Frank Kabel

Hi Frank
not quite sure what you're trying to do but maybe you're looking for
something like the following:

Dim rng as range
dim cell as range
set rng = activesheet.range("D1:F10")
for each cell in rng
cell.value = Round(cell.value*2,0)/2
next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top