Hello all,
It’s been a long long time but I’m once again working with Excel programming and I find myself back here.
I’m exporting data from a program, SalesLogix, to Excel and I’m having trouble formatting a range.
This code works:
objExcel.Range(“A” & intRow & “:D” & intRow).Interior.colorIndex = 1
objExcel.Range(“A” & intRow & “:D” & intRow).Interior.Pattern = xlSolid
objExcel.Range(“A” & intRow & “:D” & intRow).Merge
But I need to be able to replace the column reference D with a variable, and I don’t know how I would do that?
I need to be able to select a Range so I can merge the cells.(Or center across selection)
Right now I have two integers, intCol and intRow.
This works, but it isn’t a range:
objExcel.Cells(intRow, intCol).Interior.colorIndex = 1
objExcel.Cells(intRow, intCol).Interior.Pattern = xlSolid
I can’t figure out how to use the variables to select a Range.
objExcel.Range(Cells(1, 1), Cells(3, 4)).Merge
Doesn’t work.
Any idea’s?
Thank you,
Justin K.