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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
56,916
Office Version
  1. 365
Platform
  1. Windows
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.
 

ACCA369

New Member
Joined
Dec 27, 2020
Messages
48
Office Version
  1. 2019
Platform
  1. Windows
  2. MacOS
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)
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
56,916
Office Version
  1. 365
Platform
  1. Windows
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
 
Status
Not open for further replies.

Watch MrExcel Video

Forum statistics

Threads
1,129,539
Messages
5,636,903
Members
416,948
Latest member
Jkpang

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
Top