Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 01-28-2022, 09:35 PM
soroush.kalantari soroush.kalantari 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 2016
Competent Performer
HOW TO write a macro for dynamic relative named ranges in Excel?
 
Join Date: Jun 2021
Posts: 124
soroush.kalantari is on a distinguished road
Default

Quote:
Originally Posted by NoSparks View Post
I must confess, I have no idea how or why that works.
I don't know where the active cell is when you start and I guess your sheet lay out is not as I envision it,
but hey, if you're happy, I'm happy.

Good Luck with your project.
NoSparks
That was my fault. I presented my problem in wrong way. My question must be edites as follows : In the first cell of each row (column A), there is a name (header) and in the other cells there are some numbers relating to first column (for example, A1 is inflation and A1:f1 are .01,.02 …which are inflation amount of different years).
Also there was a minor problem with my codes that I solved it. (The line ActiveWorkbook.Names.Add Name:=ActiveCell.Value, RefersTo:="=" & "INDEX(" & cellAddress02 & ":" & cellAddress & "," & myrow & ") must be replaced with ActiveWorkbook.Names.Add Name:=ActiveCell.Value, RefersTo:="=" & "INDEX(" & cellAddress02 & ":" & cellAddress & "," & "row(" & cellAddress & ")" & ")". (sorry, the Edit Bottom is not available for me to edit them)
But anyway, my main problem was how to make VBA codes distinguish between text and parameter which I learned form your response.
Attached Files
File Type: xlsm namecopy.xlsm (21.1 KB, 8 views)
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 02:45 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