George,
Thanks for pointing me in the right direction. I was getting close in SQL server using the following in my column field:
REPLACE(REPLACE(REPLACE(SUBSTRING(CONVERT (VARCHAR(400), dbo.EmployeeNotes.Notes), 101, 100), '\par }', ''), CHAR(10), ''), CHAR(13), '')
I don't think this was...
Hi guys,
(This is somewhat of a revamped version of a previous question I posted. I had mistaken the RTF formatting as something to do with Collation)
I have a text field(notes) in SQL Server that is storing the data with all of the rtf formats.
{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0...
Hello,
I have a text field(notes) in SQL Server that has the Collation set to <database default>. When I query the notes field I get the notes text along with the collation info.
{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 MS Shell Dlg 2;}}
\viewkind4\uc1\pard\lang1033\f0\fs17 test comments...
Not sure how well it will post over, but here it is:
i = 8
If recExists = True Then
Do Until Range("G" & i) = "End"
If Len(Range("G" & i)) > 4 Then
If Mid(Range("G" & i), 5, 1) = "," Or Mid(Range("G" & i), 6, 1) = "," Then
arrayRange = Split(Range("G" &...
Skip,
At this point, I think you are just being an ass. I tried to have respect and tact even when you replied back with rude remarks. It looks like you've been a member on here since I was a sophomore in college, so I'm not claiming to know more or how to program better than you. I realize...
I think we are getting close. The Split works great, but it is still like I am comparing a text to a numeric. Also (not sure if it makes a difference in this case) I am attempting this in a select case statement and not a select sql statement.
It would kind of be like:
matchToMeVal = 5000...
I looked at going this route because:
1. Only one person will be using this. They are very capable of putting in the correct values, ranges, or whatever you would like to refer to them as.
2. More than likely, they won't need to be changed, but just in case, I'd thought it be nice to have that...
Skip,
I'm not sure what else to tell you as far as my intent. I'm sorry if I came off as rude, I have been stewing over this issue since last night and it has really got me flustered. I figured there would be an obvious easy answer that I was just overlooking and someone else would say, hey...
(1,2,3,4) IS a range when used in a Case Statement as a criteria
SELECT CASE arrayVariable
Case 1,2,3,4
Do something if arrayVariable is in the RANGE
1,2,3,4
Case 5 to 8
Do something else if arrayVariable is in the RANGE
from 5 to 8...
The purpose is to have somewhat of a floating Select Case statement so that way if I need to loop through 20 cells or 100 cells, I can do that while also giving the user the flexibility to change the range criteria in any given cell (which would in turn "update" the case criteria).
Basically, I'm just trying to figure out how to take a value or range from an Excel cell:
Example
G1 contains 1,2,3,4
G2 contains 5 to 15
G3 contains 16
and plug it into a SELECT CASE statement (in the Case = area)where it is not plugged in as a single string, but as a range or value.
With...
Skip,
I was just using A1 as an example. I have different ranges in different cells (G1, G2, G3...). I have to use code because I am connecting to a sql server database. I must admit I am not very good at explaining things, so instead of an example, here is a snippet of my actual code.
For...
Hey Skip,
The reason I am trying to pull this info from an Excel cell is so the end user can change the ranges on demand. I am pulling an account number from a database and then looping through the excel cells to get the ranges to determine where to plug in the data.
Thanks,
Nic
Hey guys,
I am trying to pull a range from an Excel cell and plug it into a SELECT statement in my VBA code. For example, cell A1 has 33,34,35 in it.
Sample Code:
exampleNum = 34
Select Case exampleNum
Case Range("A1").Value
EXanswer = "Yes"
Case Else...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.