Iteration, Absolute copy, Format significant digits

Copper Contributor

Hi - thanks in advance for any help on any one of these three operations - these operations are very important to me (and maybe others):

 

1) Iteration -

Assume B1 = sin(A1);

A1 = B1 - 0.1;

I need to iterate this until A1 < 0, and stop.

Although this is circular, but as there is a conditional then it can be well formed.  Of course the condition may never be met, and one can put a limit on the iteration count.

What would be the VBA code for such an iteration?

 

2) Absolute copy -

A copy or move operation in Excel will update the addresses referenced as relative addresses.

It is possible to copy as an absolute address by selecting the source cell, open the cell, copy the string, close the cell, go to the destination location, open the destination, paste the string, and then close the destination. (Note, the $A$1 absolute addressing may not be used here as the address must remain in relative form both at source and at destination.)

Is there a quick absolute copy operator that I can use to do this just in two or three steps: select source, absolute copy to destination? I do absolute copies almost as many times as I do relative copies.

 

3) Format significant digits -

I need a cell to be formatted such that only 3 significant digits are displayed. Examples:
34,262.55 is displayed automatically as 34,300
3,426,255 is displayed as 3,430,000
0.00003426255 is displayed as 0.0000343

0.003404 is displayed as 0.00340

Rounding may not have to be in effect.

 

Thank you so much.

Brom

2 Replies

@Brom_Nader 

  1. What have you tried yourself so far?
  2. A trick I sometimes use is this:
    1. Select the cells you want to copy
    2. Press control+H to open the Replace dialog
    3. Find the = sign and replace with a character not otherwise in the formulas, like the | character or the @
    4. Copy the (now plain text) cells
    5. Paste them
    6. Do the replace operation again reversing the find and replace with characters
  3. Perhaps this article helps: https://jkp-ads.com/articles/round2digits.asp 
This is a very lengthy sequence of operations. I need at most one click or two clicks.

Pls. read my original post and it explains how I do it, which is not too different from yours.