Convert value

  • Thread starter Thread starter Michael168
  • Start date Start date
M

Michael168

Hello! Can someone show how to do this in VBA?

Example.

Range 1 is from A2:D8 . e.g. A2=1

Range 2 is from A10:J1000 . e.g. J1000=1

I want to convert J1000=A2.

I need to convert all the individual cell value of range 2 to the cel
address of range 1 if the value in range 2 is equal to the value i
range 1.

Regards,
Michae
 
Dim cell as Range, cell1 as Range
for each cell in Range("A10:J1000")
for each cell1 in Range("A2:D8")
if cell = cell1 then
cell.Value = cell1.Address(0,0)
exit for
end if
Next
Next
 
Hi!Tom,
Sorry I miss out one word if should be equal to address formula so tha
when I change anything cell value in A2:D8 the values in the range
will change accordingly.

e.g. A2=1

J1000=1

J1000= "=A2"

Thanks,
Michael.
 
Hi!Tom,
Sorry I miss out one word if should be equal to address formula so tha
when I change anything cell value in A2:D8 the values in the range
will change accordingly.

e.g. A2=1

J1000=1

J1000= "=A2"

Thanks,
Michael.
 
Dim cell as Range, cell1 as Range
for each cell in Range("A10:J1000")
for each cell1 in Range("A2:D8")
if cell = cell1 then
cell.Value = "=" & cell1.Address(0,0)
exit for
end if
Next
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

Back
Top