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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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,908
Messages
6,122,187
Members
449,071
Latest member
cdnMech

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