Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Limit on Column Selection

Hi All,

I have a requirement where I might need to replace the text in Cells
for particular columns. I have a form where I get the input from the
user asking them the fields they would want me to replace the text in.
I store the column numbers in a variant array. I then do an iteration
which is something like

Do While (intFieldCount <= UBound(vUpdFieldsCol))
strCol = Left(Cells(1, vUpdFieldsCol
(intFieldCount)).Address(False, False), 1 - (vUpdFieldsCol
(intFieldCount) 26))
If (Len(strSelection) = 0) Then
strSelection = strSelection & strCol & "9:" &
strCol & intRngEnd
Else
strSelection = strSelection & "," & strCol &
"9:" & strCol & intRngEnd
End If
intFieldCount = intFieldCount + 1
Loop

But after the strSelection construction has been completed I do a
Sheet.Range(strSelection).select which fails and when I debug the
value of strSelection, I find the value has not been completely picked
up. I checked to see the limit of the datatype string and my values
are just a miniscule fraction of the 2 billion characters. Am I
missing something, can you guys let me know whats wrong with what I
have written?

Thanks and Regards,
Haarish.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Limit on Column Selection

I re-wrote the code and it doesn't look like it does what you are expecting

Do While (intFieldCount <= UBound(vUpdFieldsCol))

MyStr = Cells(1,
vUpdFieldsCol(intFieldCount)).Address(RowAbsolute: =False,
columnabsolute:=False)
if vUpdFieldsCol(intFieldCount) 26 then

strCol = Left(MyStr, 0)
else
strcol = left(MyStr, 1)
end if

If (Len(strSelection) = 0) Then
strSelection = strSelection & strCol & "9:" & strCol & intRngEnd
Else
strSelection = strSelection & "," & strCol & "9:" & strCol &
intRngEnd
End If

intFieldCount = intFieldCount + 1
Loop


"Haarish" wrote:

Hi All,

I have a requirement where I might need to replace the text in Cells
for particular columns. I have a form where I get the input from the
user asking them the fields they would want me to replace the text in.
I store the column numbers in a variant array. I then do an iteration
which is something like

Do While (intFieldCount <= UBound(vUpdFieldsCol))
strCol = Left(Cells(1, vUpdFieldsCol
(intFieldCount)).Address(False, False), 1 - (vUpdFieldsCol
(intFieldCount) 26))
If (Len(strSelection) = 0) Then
strSelection = strSelection & strCol & "9:" &
strCol & intRngEnd
Else
strSelection = strSelection & "," & strCol &
"9:" & strCol & intRngEnd
End If
intFieldCount = intFieldCount + 1
Loop

But after the strSelection construction has been completed I do a
Sheet.Range(strSelection).select which fails and when I debug the
value of strSelection, I find the value has not been completely picked
up. I checked to see the limit of the datatype string and my values
are just a miniscule fraction of the 2 billion characters. Am I
missing something, can you guys let me know whats wrong with what I
have written?

Thanks and Regards,
Haarish.

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
Filiter and Limit selection in Combo box / List Box in the UserFor Icy Excel Worksheet Functions 0 November 3rd 07 12:42 AM
Filiter and Limit selection in Combo box / List Box in the UserFor Icy Excel Programming 2 November 2nd 07 06:40 PM
How to limit columns that display based on selection of a dropdown value Hrwilkers Excel Worksheet Functions 5 August 14th 07 07:04 PM
Refedit - Limit selection to only one cell Andibevan Excel Programming 0 March 14th 06 09:51 AM
limit cell list selection based on the selection of another list lorraine Excel Worksheet Functions 2 December 14th 04 08:17 PM


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