Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Naming a range | Excel Discussion (Misc queries) | |||
plotting 2 variables as scatter and naming each point | Charts and Charting in Excel | |||
Naming Variables | Excel Programming | |||
VB Code Naming a Range (range changes each time) | Excel Programming | |||
naming multiple public variables generated by single function | Excel Programming |