Changing cell values

Peter1973

Well-known Member
Joined
May 13, 2006
Messages
957
Is it possible to change cell values according to the last cell value eg:

I have a row of cell say A10:Z10 in these cells different letters are entered say either H, R or W is it possible that if I imput the letter S in a cell that every cell to the right of that S which contains a W will change to S, and vice versa ?
 
Yes, if you've changed the ranges in both the Worksheet_SelectionChange and the
Worksheet_Change routines from D10:BB70 and D71:BB256 to H7:IA75 and H80:IA240
then it will still only work up to column BB. Column BB is being specified in the lines:
If ThisCol < 54 Then (and)
For Col = ThisCol To 54

Column BB is the 54th column to the right starting from Column A (Column1).
Column IA is the 235th column to the right.)

If you change both instances of 54 to 235 then it should work all the way out to column IA.

One quick way to figure out what the column number of any given column is (without
having to physically count them) is to use this formula anywhere in the column(s) of
interest.
=Column() This will return the column number. (Very handy to know when
you're writing code.) :wink:

After changing the ranges (in both routines) and the number of columns to loop through,
does it work alright now?
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
HalfAce, Peter1973,

I'm little unclear. Did someone try the formula and did it give the desired results?

Dufus
 
Upvote 0
Hi Dufus,
Yes, I just tried it and it works great for the column the change was made in but I didn't
get any values to the right of that column to change.

Does it change those as well for you?

[EDIT:]
I stand corrected. Don't know what I did wrong the first time but it seems to be working
for me now.
Very cool solution indeed! :cool:
 
Upvote 0
Cool. I haven't had time to decipher all the code and exanches but, I'm sure dipping a foot in the macro pool will serve the OP well in the future. Good work! That's what this is all about.
 
Upvote 0

Forum statistics

Threads
1,214,780
Messages
6,121,527
Members
449,037
Latest member
tmmotairi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top