Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-24-2022, 01:51 PM
NoSparks NoSparks is offline HOW TO write a macro for dynamic relative named ranges in Excel? Windows 10 HOW TO write a macro for dynamic relative named ranges in Excel? Office 2010
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

Not sure about what you're doing or how you're going about it,
but for the answers to the questions you've asked
Quote:
1.VBA consider parameters of my macro as text not value (for example, VBA considers cellAddress02 as “cellAddress02” not $A$1 which is what I expect)
the variables cannot be within quotes
Code:
"=INDEX(cellAddress02:cellAddress,myrow)"
'should be
"=INDEX(" & cellAddress02 & ":" & cellAddress & "," & myrow & ")"
Quote:
2.For making my named ranges relative rather than absolute, I need a VBA function to give a cell address which doesn't have $ signs before the letter (for example, I want A$1 not $A$1)
use
Code:
cellAddress = cell.Parent.Name & "!" & cell.address(1,0)
Reply With Quote
 

Tags
address, macro, relative named ranges



Similar Threads
Thread Thread Starter Forum Replies Last Post
Use of named ranges based on cell content Intruder Excel 12 02-25-2019 09:42 AM
HOW TO write a macro for dynamic relative named ranges in Excel? Named Ranges Help SavGDK Excel 5 05-01-2017 09:41 AM
How to use named ranges in excel vba? bosve73 Excel Programming 4 01-25-2012 09:26 AM
Dynamic Named Ranges using text hannu Excel 0 06-22-2010 04:42 PM
Can't import home adresses in outlook 2010 from excel named ranges eekie Outlook 0 05-14-2010 02:04 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:19 AM.


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