Link column of sheet 1 with sheet 2 using VBA

Status
Not open for further replies.

ACCA369

New Member
Joined
Dec 27, 2020
Messages
48
Office Version
  1. 2019
Platform
  1. Windows
  2. MacOS
Samples
34
12
6
16
14
23
5
14
27
12
17
0
35
30
23
18
32
13
29
22
34
34
27
31
18
20
11
4
25
32
12
0
32
7
1
32


Above data are from sheet1 ,
Pls help me to link all these data to sheet 2 using vba
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
I think we are missing some very important details!

What do you mean by "link"?
Do you want to create formula reference for each one?, i.e.
=Sheet1!A1

If so, in what range on Sheet1 does the data exist, and in what range on Sheet2 do you want to put these formulas?

If you just want to copy the data, we need the same information regarding ranges.
 
Upvote 0
I think we are missing some very important details!

What do you mean by "link"?
Do you want to create formula reference for each one?, i.e.
=Sheet1!A1

If so, in what range on Sheet1 does the data exist, and in what range on Sheet2 do you want to put these formulas?

If you just want to copy the data, we need the same information regarding ranges.
1) Yes, create formula reference using VBA
2) sheet 2 range same as sheet 1
3) sheet 1 range (a:a)
 
Upvote 0
Try this:
VBA Code:
Sub MyAddLink()

    Dim lr As Long
    
'   Find last row on Sheet1 in column A with data
    lr = Sheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row
    
'   Populate sheet2 with formulas
    Sheets("Sheet2").Range("A1:A" & lr).FormulaR1C1 = "=Sheet1!RC"

End Sub
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,854
Messages
6,121,941
Members
449,056
Latest member
denissimo

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