PDA

View Full Version : Convert from range to tables and code support?



GhostofDoom
12-22-2019, 05:42 AM
Hello,

it seems we like to add the xlsm to a server
but it can't be access by multiusers at once
just for reading

and i have found an option in excel but seems i have to convert every range to a table
yea that's easy

but the problem is i have to change all the codes we have so far to make it work with the 'table' support

the most codes we using is for searching but problem is it will only work if it match the string :(
is there an option we can use the search part so search like we do in the range?

code range:
match everything with 1 criteria or even empty criteria



DataSH.Range("T9").Value = txtSearch.Text
DataSH.Range("B8").CurrentRegion.AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=DataSH.Range("T8:T9") _
, CopyToRange:=DataSH.Range("V8:AM8")


ListBox1.RowSource = DataSH.Range("outdata").Address(external:=True)


code table:
just only match criteria if the same string like for example 'Mark' not m or mark or empty criteria



With ListBox1
.List = Sheets("TestingImport").ListObjects(1).DataBodyRange.Value
For j = .ListCount - 1 To 0 Step -1

If .List(j, 16) & .List(j, 6) <> "x" & txtSearch.Text Then .RemoveItem j

Next j



Thanks

Dave
12-22-2019, 09:01 AM
Hi Ghost of Doom. This post seems very similar to your previous post which has many views and no responses. That usually means that your post makes it difficult to provide help. I don't understand this post either. U want to add items to a listbox based on some criteria... be specific where is the criteria and what is it? See the "Instr" function to match exact strings. HTH. Dave

GhostofDoom
12-22-2019, 09:18 AM
Hello Dave,

Well this post will be more about the TABLE part to be searching on because it seems we wanna use it for a server to access from
and to make it share possible we need to replace all the range to table parts

yeah i know its always hard to explain it because in my head is simple but not for explaining :)

okay let see,

as my example said we search for some criteria that contains from the column B C N
with a combobox we can set where to search for B C N column
like i showed in the range code the textbox will be searching for the B in the sample

and for the Table code
is like the same but the criteria must be exactly as in the row because it wont work with just pieces of the criteria

hope its better now
if not let me know
and i will try to make a demo sheet with the same code
but other values then

Thank you

here the demo sheet
in vba frmrangeform it will search on firstname or even empty fields if you don't add name

in vba frmtableform it will also search on firstname but it has to be exact the same value or it will not work
and that part we wanna change so it doesn't matter how many chars or upper of lower cases or even empty ones
it has to be working like frmrangeform

thank you