Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-04-2024, 09:04 PM
soroush.kalantari soroush.kalantari is offline Making a macro linking two range more efficient. Windows 10 Making a macro linking two range more efficient. Office 2021
Competent Performer
Making a macro linking two range more efficient.
 
Join Date: Jun 2021
Posts: 115
soroush.kalantari is on a distinguished road
Default Making a macro linking two range more efficient.

I have written a macro to link a “ destination range" to “ visible cells” of “source range”. see the attached Excel, in which, if I be in sheet1!A1 and the "source range" be “Sheet2'!A1:P43” I want the sheet1!A1 formula be “=Sheet2!A1” and sheet1!A2 formula be "=Sheet2!A13” (connecting 1th,2th and .. row of “destination range” to1th,2th and .. “visible rows” of source range. Run the macro assigned to the rectangular in sheet1 to see what I want. In the inputbox "source rage" should be selected.).
My macro does what is expected, but it is slow when dealing with large data and because of this, I am seeking some ways to make it more efficient.


Can you guide me on this issue?
Attached Files
File Type: xlsm link.xlsm (25.4 KB, 5 views)

Last edited by soroush.kalantari; 03-05-2024 at 09:03 PM.
Reply With Quote
  #2  
Old 03-13-2024, 08:26 AM
p45cal's Avatar
p45cal p45cal is offline Making a macro linking two range more efficient. Windows 10 Making a macro linking two range more efficient. Office 2021
Expert
 
Join Date: Apr 2014
Posts: 871
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

try:
Code:
Sub blah()
Dim rng0 As Range, cll0 As Range
Set cll0 = Selection
Set rng0 = Application.InputBox(Prompt:="Select source range", Type:=8)
rng0.SpecialCells(xlCellTypeVisible).Copy
Application.Goto cll0
ActiveSheet.Paste Link:=True
Application.CutCopyMode = False
End Sub
Reply With Quote
  #3  
Old 03-17-2024, 12:09 AM
soroush.kalantari soroush.kalantari is offline Making a macro linking two range more efficient. Windows 10 Making a macro linking two range more efficient. Office 2021
Competent Performer
Making a macro linking two range more efficient.
 
Join Date: Jun 2021
Posts: 115
soroush.kalantari is on a distinguished road
Default

Thank you very much. Your reply solved the problem and as always learned me new things.
Reply With Quote
Reply

Tags
link, visible



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help making a Macro Mullin4414 Word VBA 4 03-06-2023 09:17 AM
Problem with efficient organisation of pictures in my pub Croitz Publisher 0 12-22-2018 05:48 AM
Making a macro linking two range more efficient. Linking Range of Cells in a Row friesjh Excel 5 06-28-2016 10:22 AM
Most efficient way to store numerous charts? RAB PowerPoint 0 07-13-2015 07:17 AM
Making a macro linking two range more efficient. Macro Question: Need help making a macro to highlight the first word in every sentence LadyAna Word 1 12-06-2014 10:39 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:35 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft