Macro: Changing the value of a Cell

Costafrank

New Member
Joined
Feb 6, 2004
Messages
2
Hello,


How can I change the value of one cell if another cell has a string.

ex:

Row 1 Colum 7(G1) Has the value of "TEST" (or anyother string) now I would like to change row 1 colum 2 (b1) to "TEST" if it is empty, I would like to do an autofill from the cell above.

thanks
Frank
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Costafrank said:
...if it is empty... do an autofill from the cell above...

<ul>[*]If what is empty? B1 or G1?[*]What cell is "above"? You're in row 1.[/list]
 
Upvote 0
Greg,

If G1 is empty. I would like it to fill from above because I will always have one row at the top, with a valid formula.

I choose ROW 1 and COLUM 1 just as an example.

you can make it ROW 2 COLUM 2 (B2) & ROW 2 COLUM 7 (G2).

also, it needs to check on a range of cells so G2-G500 and update the appropiate cell in range (b2-b500)


thanks
Frank
 
Upvote 0
If I've understood you accurately, the easiest way to do this would be to just use an IF() function to test for blanks. One certainly could quite literally make so that column G was checked for a value and copy a formula down in col B, but that would involve the use of VB and why make life more complicated than need be? Note, to keep the HTML shorter, I used col C as the column to test here, just change that to G and copy down as far as you need to.

HTH
Book1
ABCD
1DummyDataIfcolCisempty,multiplyA*5ColtoCheckComments
215Hello
32103.141592654
43159-Feb-04
54 <--Blank
65250<--Zero(notblank)
Sheet1
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,192
Members
449,072
Latest member
DW Draft

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