Duplicating cell value

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
2,040
Office Version
  1. 2019
Platform
  1. Windows
Hello all,

In cell A1 I have a value = $C$4

in E2 I have value = Apple

How do I duplicate the value in E2 example Apple, to cell C4.

So that E2 and C4 are both = Apple

Similarly if A1 value = $C$2

then E2 and C2 = Apple.

Will appreciate.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
You explanation is very confusing.

Why wouldn't you just set the formula equal to the other cell?

Perhaps you should try walking us through an actual example, with a little bit better explanation.
 
Upvote 0
You explanation is very confusing.

Why wouldn't you just set the formula equal to the other cell?

Perhaps you should try walking us through an actual example, with a little bit better explanation.T

The value which is given in cell E2 is derived from an indexed match formula which matches a power query list. That list will update itself via macro which runs in a loop
every minute or so, hence the list may change or may not change each time it runs resulting in a different value in E2. After the value in E2 is duplicated to the column adjacent to the said list, then some set of macros will need not to be run whcih will run otherwise, meaning if the value is not duplicated.

VBA Code:
Sub Repeat_Process()
If ThisWorkbook.Worksheets("HSheet").Range("D3").Value2 = 1 Then
Application.OnTime DateAdd("s", 1, Now), "Copy_Text"
Application.OnTime DateAdd("s", 2, Now), "Save_Workbook"
Application.OnTime DateAdd("s", 3, Now), "Open_Workbook"
Application.OnTime DateAdd("s", 13, Now), "Activate_Workbook"
Application.OnTime DateAdd("s", 17, Now), "Refresh_Workbook"
Application.OnTime DateAdd("s", 35, Now), "Convert_Workbook"
Application.OnTime DateAdd("s", 47, Now), "Copy_Workbook"
Application.OnTime DateAdd("s", 48, Now), "Close_Workbook"
Application.OnTime DateAdd("s", 50, Now), "Reopen_Workbook"
Else
If ThisWorkbook.Worksheets("HSheet").Range("F7").Value2 <> 1 Then
Application.OnTime DateAdd("s", 2, Now), "Copy_Text"
Application.OnTime DateAdd("s", 3, Now), "Activate_Workbook"
Application.OnTime DateAdd("s", 10, Now), "Refresh_Workbook"
End If
End If
Application.OnTime DateAdd("s", 60, Now), "Repeat_Process"
End Sub

You could see it's a complicated process. I need the ansser to my original post please, so that I can continue with this process.
 
Upvote 0
Yes, that is much more complicated than your original post.
You should really include all these details in the original post of your question.

I still don't really understand your process, as I have not been involved in all the previous stuff at all. All I know is what you told me in this thread. But if you simply want to duplicate the value in cell E2, then why not just use the formula:
Excel Formula:
=E2
 
Upvote 0
Yes, that is much more complicated than your original post.
You should really include all these details in the original post of your question.

I still don't really understand your process, as I have not been involved in all the previous stuff at all. All I know is what you told me in this thread. But if you simply want to duplicate the value in cell E2, then why not just use the formula:
Excel Formula:
=E2
Because there is time between the source value and the destination value where the macro will need to run. After the macro complete its task only then the value needs to be duplicated via vba and not a formula , so that the same macro would not run over and over which is dependant on E2. When the value is duplicated then the macro will no longer run.
 
Upvote 0
So, if I am understanding you right, then just have your VBA code assign the value.
For example, if you wanted to set the value in cell C2 equal to what is in E2, you would just have a line like:
VBA Code:
Range("C2").Value = Range("E2").Value
 
Upvote 0
Do you mean something like this?

VBA Code:
Sub test()
Dim ws As Worksheet
Dim dubTRNG As Range
Set ws = ThisWorkbook.ActiveSheet
Set dubTRNG = ws.Range(ws.Range("A1").Value)
dubTRNG.Value = ws.Range("E2").Value
End Sub
 
Upvote 0
Solution
Do you mean something like this?

VBA Code:
Sub test()
Dim ws As Worksheet
Dim dubTRNG As Range
Set ws = ThisWorkbook.ActiveSheet
Set dubTRNG = ws.Range(ws.Range("A1").Value)
dubTRNG.Value = ws.Range("E2").Value
End Sub

Thank you Tupe77 (y)
 
Upvote 0
Ah, so it appears you just wanted one cell to contain the literal cell reference of the range you wanted it look up.
I am glad Tupe77 was able to understand what you were looking for.
 
Upvote 0

Forum statistics

Threads
1,215,737
Messages
6,126,570
Members
449,318
Latest member
Son Raphon

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