LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How to quickly name cells in a row using VBA?

Hi

I have to name 75 cells in a row starting from cell B4. B4 will be
named dbtr1, C4 dbtr 2 and so on.

I tried using the following code but it doesn't actually put the name
of the cell in the name box (top left had corner), however it does
show up when I go to Insert - Name - Define and it refers to the
correct cell.

I'd like the name to show up in the name box when I click the little
drop down that shows you all the named ranged in the workbook.

Sub Macro1()

Dim i As Integer

For i = 1 To 75

'ActiveWorkbook.Names.Add Name:="dbtr" & i, RefersToR1C1:="=Output
Database!R4C" & i + 1
ActiveWorkbook.Names("dbtr" & i).Delete

Next i

End Sub
 
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
Excel - how to autofill thousands of cells quickly Dennis H Excel Discussion (Misc queries) 5 May 13th 23 03:42 AM
Merge the same group of cells down a column quickly Rich F Excel Discussion (Misc queries) 9 February 12th 10 02:30 PM
How can I quickly identify protected cells? Quin Excel Discussion (Misc queries) 6 June 26th 08 09:17 PM
How do I quickly enter the same number into different cells? Cheers100 New Users to Excel 2 February 18th 06 02:26 PM
Quickly typing dates into cells olasa Excel Discussion (Misc queries) 0 May 24th 05 11:33 PM


All times are GMT +1. The time now is 03:00 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"