Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Need some help to make a macro that check value in B3 against values in D3,
F3, H3 if any of the values are the same as in B3 it shall be replaced with value in A3. Then it shall go to B4 and do the same sheck With D4 , F4 and H4 untill it reach the last entry inn B collone Finn |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Does it make any difference if we change B3 or change the cell that matches
its value? -- Gary''s Student gsnu200711 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Mar 22, 3:07 pm, Gary''s Student
wrote: Does it make any difference if we change B3 or change the cell that matches its value? -- Gary''s Student gsnu200711 This should work. (It hasn't been tested) Option Explicit Sub macro1() Dim a Dim counter Dim aVal counter = Range("A1").CurrentRegion.Rows.Count For a = 1 To counter aVal = Range("A" & a).Value If Range("B" & a).Value = Range("D" & a).Value Then Range("D" & a).Value = aVal End If If Range("B" & a).Value = Range("F" & a).Value Then Range("F" & a).Value = aVal End If If Range("B" & a).Value = Range("H" & a).Value Then Range("H" & a).Value = aVal End If Next End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "matt" wrote: This should work. (It hasn't been tested) Thanks it works excellent |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to check if the values in a range of cells are greater than 0 | Excel Worksheet Functions | |||
Copy and replace xlsm files, but retain the values in selected cells... | Excel Discussion (Misc queries) | |||
check for FALSE values in a range of cells in VBA | Excel Discussion (Misc queries) | |||
Replace values in shaded cells with blanks | Excel Discussion (Misc queries) | |||
Need formula to check values of data in several cells as criteria | Excel Worksheet Functions |