Databases

  • Thread starter aeroNet88
  • 2 comments
  • 423 views
I'm trying to set up a database using Excel and i can't quite get it to work... the following code is the problem:

row = xlsheet.Cells(2, 3)
xlsheet.Cells(1, row) = tbxNewname.Text

What it's supposed to do is use the integer stored in cell(2,3), which changes a lot depending on the user, and then store the text in that textbox into a cell that corresponds with that integer...the problem is that it doesn't like the variable "row" inside the parenthesis like that...i'm not sure what to do to get it to work. If anyone knows a lot about using Excel within VB i could use your help..lol
 
Perhaps this is a stupid suggestion (I've never used VB before), but what about:

xlsheet.Cells(1, (xlsheet.Cells(2, 3))) = tbxNewname.Text

?
 
amp88
Perhaps this is a stupid suggestion (I've never used VB before), but what about:

xlsheet.Cells(1, (xlsheet.Cells(2, 3))) = tbxNewname.Text

?


Thanks...i tried it and it almost worked..lol..for some reason it still doesn't like the code...but if nothing else you helped me clear up a line or two code so thanks for that!
 
Back