Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Variable value from named cell

I need to enhance the following code from JE Mcgimpsey (if not mistaken). nt.
The €œ4992€ is to be made variable, ie. value from a cell named €œRowCount€
which has the formula €œ=Rows()€.

Dim i As Long
For i = 2 To 4992 Step 26
Cells(i, 18).Resize(1, 30).Value = _
Cells(i + 25, 18).Resize(1, 30).Value
Next i
End Sub

Any assistance will be appreciated.
Thank you
--
Robert
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Variable value from named cell

Hi Robert,

Try:

Dim i As Long
For i = 2 To Range("RowCount").Value Step 26
Cells(i, 18).Resize(1, 30).Value = _
Cells(i + 25, 18).Resize(1, 30).Value
Next i

---
Regards,
Norman



"Robert" wrote in message
...
I need to enhance the following code from JE Mcgimpsey (if not mistaken).
nt.
The "4992" is to be made variable, ie. value from a cell named "RowCount"
which has the formula "=Rows()".

Dim i As Long
For i = 2 To 4992 Step 26
Cells(i, 18).Resize(1, 30).Value = _
Cells(i + 25, 18).Resize(1, 30).Value
Next i
End Sub

Any assistance will be appreciated.
Thank you
--
Robert



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Variable value from named cell

Thank you Norman. Have tested and incorporated.
--
Robert



Reply
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
SUMPRODUCT using an absolute value or a named variable Joe Mac Excel Discussion (Misc queries) 2 August 19th 09 11:27 PM
Variable names for named range Barb Reinhardt Excel Discussion (Misc queries) 4 March 19th 07 05:37 PM
DDE linking with variable from named cell! Ben Joiner Links and Linking in Excel 1 March 24th 05 11:32 PM
referencing a named range using a variable mark kubicki Excel Programming 0 May 7th 04 12:15 AM
Can A Named Range Be A Variable? Minitman[_2_] Excel Programming 7 February 25th 04 11:41 PM


All times are GMT +1. The time now is 09:19 AM.

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

About Us

"It's about Microsoft Excel"