Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 149
Default Naming Range Variables

If I want to pass the variable iRefStart to the DeleteCells() Function, what
syntax is needed? Below, I'm just trying to say"Start at Cell B1"

Sub CleanSpreed()
iRefStart = "B"
Call DeleteCells(iRefStart)

Function DeleteCells(ByVal iRefStart As String)

Dim rng As Range

Set rng = Range(iRefStart & "1:B10")


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default Naming Range Variables

The only thing I would add is...
Dim iRefStart As String
HTH,
Gary Brown


"scott" wrote:

If I want to pass the variable iRefStart to the DeleteCells() Function, what
syntax is needed? Below, I'm just trying to say"Start at Cell B1"

Sub CleanSpreed()
iRefStart = "B"
Call DeleteCells(iRefStart)

Function DeleteCells(ByVal iRefStart As String)

Dim rng As Range

Set rng = Range(iRefStart & "1:B10")



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Naming Range Variables

Your function does not indicate that it has a return value. Is that an
oversight or is it not really a function? As it stands it is a sub...

"scott" wrote:

If I want to pass the variable iRefStart to the DeleteCells() Function, what
syntax is needed? Below, I'm just trying to say"Start at Cell B1"

Sub CleanSpreed()
iRefStart = "B"
Call DeleteCells(iRefStart)

Function DeleteCells(ByVal iRefStart As String)

Dim rng As Range

Set rng = Range(iRefStart & "1:B10")



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 149
Default Naming Range Variables

I'm just trying to pass "B" to the Function and allow the function to
concatenate the "B" with a "1" to set the begin cell. Can you help me
rewrite it or point out why it won't work?

The function works fine hard coded with Set rng = Range("B1:B10")



"Jim Thomlinson" wrote in message
...
Your function does not indicate that it has a return value. Is that an
oversight or is it not really a function? As it stands it is a sub...

"scott" wrote:

If I want to pass the variable iRefStart to the DeleteCells() Function,
what
syntax is needed? Below, I'm just trying to say"Start at Cell B1"

Sub CleanSpreed()
iRefStart = "B"
Call DeleteCells(iRefStart)

Function DeleteCells(ByVal iRefStart As String)

Dim rng As Range

Set rng = Range(iRefStart & "1:B10")





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Naming Range Variables

Your code works fine for me. What problem are you having? What
exact error message do you receive on what line of code?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"scott" wrote in message
...
I'm just trying to pass "B" to the Function and allow the
function to concatenate the "B" with a "1" to set the begin
cell. Can you help me rewrite it or point out why it won't
work?

The function works fine hard coded with Set rng =
Range("B1:B10")



"Jim Thomlinson"
wrote in message
...
Your function does not indicate that it has a return value. Is
that an
oversight or is it not really a function? As it stands it is a
sub...

"scott" wrote:

If I want to pass the variable iRefStart to the DeleteCells()
Function, what
syntax is needed? Below, I'm just trying to say"Start at Cell
B1"

Sub CleanSpreed()
iRefStart = "B"
Call DeleteCells(iRefStart)

Function DeleteCells(ByVal iRefStart As String)

Dim rng As Range

Set rng = Range(iRefStart & "1:B10")









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 149
Default Naming Range Variables

no error, my code that takes action doesn't fire when using the variable for
"B"


"Chip Pearson" wrote in message
...
Your code works fine for me. What problem are you having? What exact
error message do you receive on what line of code?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"scott" wrote in message
...
I'm just trying to pass "B" to the Function and allow the function to
concatenate the "B" with a "1" to set the begin cell. Can you help me
rewrite it or point out why it won't work?

The function works fine hard coded with Set rng = Range("B1:B10")



"Jim Thomlinson" wrote in
message ...
Your function does not indicate that it has a return value. Is that an
oversight or is it not really a function? As it stands it is a sub...

"scott" wrote:

If I want to pass the variable iRefStart to the DeleteCells() Function,
what
syntax is needed? Below, I'm just trying to say"Start at Cell B1"

Sub CleanSpreed()
iRefStart = "B"
Call DeleteCells(iRefStart)

Function DeleteCells(ByVal iRefStart As String)

Dim rng As Range

Set rng = Range(iRefStart & "1:B10")









  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 149
Default Naming Range Variables

it works now. thanks.

"Chip Pearson" wrote in message
...
Your code works fine for me. What problem are you having? What exact
error message do you receive on what line of code?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"scott" wrote in message
...
I'm just trying to pass "B" to the Function and allow the function to
concatenate the "B" with a "1" to set the begin cell. Can you help me
rewrite it or point out why it won't work?

The function works fine hard coded with Set rng = Range("B1:B10")



"Jim Thomlinson" wrote in
message ...
Your function does not indicate that it has a return value. Is that an
oversight or is it not really a function? As it stands it is a sub...

"scott" wrote:

If I want to pass the variable iRefStart to the DeleteCells() Function,
what
syntax is needed? Below, I'm just trying to say"Start at Cell B1"

Sub CleanSpreed()
iRefStart = "B"
Call DeleteCells(iRefStart)

Function DeleteCells(ByVal iRefStart As String)

Dim rng As Range

Set rng = Range(iRefStart & "1:B10")









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
Naming a range bob777 Excel Discussion (Misc queries) 1 February 1st 06 01:05 PM
plotting 2 variables as scatter and naming each point Jane Charts and Charting in Excel 1 June 22nd 05 03:55 PM
Naming Variables Terri[_5_] Excel Programming 1 October 11th 04 04:16 PM
VB Code Naming a Range (range changes each time) krazylain Excel Programming 4 May 15th 04 12:41 PM
naming multiple public variables generated by single function Mark Kubicki Excel Programming 1 July 22nd 03 09:25 PM


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

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"