LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 846
Default vba logic - so close but not quite there (adding names with vba)

Does anyone know how to fix the code below? It's not setting the ranges
correctly

Sub Addnames1()
Dim irow As Integer

irow = 0
With shtTerm.Range("bx25")
Do
ActiveWorkbook.Names.Add _
Name:=.Offset(irow, 0), _
RefersTo:= _
.Offset(irow, 1).Value
irow = irow + 1
Loop Until .Offset(irow, 0) = ""
End With
End Sub




Starting in bx25
TR30MNE V23:V61
TR30MPE W23:W61
TR30MSE X23:X61
TR30FNE Y23:Y61
TR30FPE Z23:Z61
TR30FSE AA23:AA61
TR30UNE AB23:AB61
TR30UPE AC23:AC61
TR30USE AD23:AD61
TR30MNE AE23:AE61
TR30MPE AF23:AF61
TR30MSE AG23:AG61
TR30FNE AH23:AH61
TR30FPE AI23:AI61
TR30FSE AJ23:AJ61
TR30UNE AK23:AK61
TR30UPE AL23:AL61
TR30USE AM23:AM61


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
help with adding names CHAD Excel Discussion (Misc queries) 1 December 24th 09 05:23 PM
Adding a Close Workspace option when right-clicking Excel in taskb Handsome Prints Setting up and Configuration of Excel 0 September 4th 09 03:34 AM
Create totals for close-matching names? t_perkins Excel Worksheet Functions 7 May 6th 08 10:39 PM
Adding in a piece of logic to my complicated formula! Dan the Man[_2_] Excel Worksheet Functions 3 July 4th 07 04:42 AM
Adding an error message at close of file when criteria are met Dave Excel Discussion (Misc queries) 3 August 12th 05 07:56 PM


All times are GMT +1. The time now is 10:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"