Hi
This follows on from a previous post and shows my ignorance of XL-VBA objects.
thread707-690573
What is out of range in the code below ???
Debug shows the string strWkShtDatafile has the correct string value for the sheetname ie "Svcs-Master".
and the strX has the value "A2"
For intRowNbr = intRowStart To intRowEnd
strRowNbr = Format(intRowNbr, "#"
strX = strColProgramCode & strRowNbr
strValProgramCode = Sheets(strWkShtDatafile).Range(strX).Value
' Other code omitted
Next intRowNbr
Any Ideas?
I have also tried
strRowNbr = Format(intRowNbr, "0"
but it makes no difference.
I'm just trying to get values from one wkbk and put them in another. I also want to use the values in a SaveCopyAs so I cant do a simple copy & paste between cells. I need to concatenate string values from 3 cells in the datasheet.
Another Error I may have made this that
strValProgramCode is a string but the value in the cell is a number. I will try again changing the variable to a different data type.
Zollo9999 A+
(Very Part-Time Programmer)![[thumbsup] [thumbsup] [thumbsup]](/data/assets/smilies/thumbsup.gif)
This follows on from a previous post and shows my ignorance of XL-VBA objects.
thread707-690573
What is out of range in the code below ???
Debug shows the string strWkShtDatafile has the correct string value for the sheetname ie "Svcs-Master".
and the strX has the value "A2"
For intRowNbr = intRowStart To intRowEnd
strRowNbr = Format(intRowNbr, "#"
strX = strColProgramCode & strRowNbr
strValProgramCode = Sheets(strWkShtDatafile).Range(strX).Value
' Other code omitted
Next intRowNbr
Any Ideas?
I have also tried
strRowNbr = Format(intRowNbr, "0"
but it makes no difference.
I'm just trying to get values from one wkbk and put them in another. I also want to use the values in a SaveCopyAs so I cant do a simple copy & paste between cells. I need to concatenate string values from 3 cells in the datasheet.
Another Error I may have made this that
strValProgramCode is a string but the value in the cell is a number. I will try again changing the variable to a different data type.
Zollo9999 A+
(Very Part-Time Programmer)
![[thumbsup] [thumbsup] [thumbsup]](/data/assets/smilies/thumbsup.gif)