Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all, i have created the code below to loop through all the part numbers
intererd into txt_PrtNumber, this is working fine, but now i need to add the part description as well, i am baffled here and do not know what to do. Any help would be much appreciated. Dim vPrtNums As String, lmyAdd As Variant Dim MyNums As Variant, sPrtDescr As String, myDescr As Variant Dim i, d vPrtNums = frm_InputTM.txt_PrtNumber i = Split(vPrtNums, ",") MyNums = i If frm_InputTM.Opt_SevPartsOneSupp = True Then For Each i In MyNums If i = "" Then Else With ActiveWorkbook.ActiveSheet Range(vmyCol & vmyRow) = i Range(vmyCol & vmyRow).Offset(0, 4) = sPrtDescr Range(vmyCol & vmyRow).Offset(0, 5) = sModel End With End If vmyRow = vmyRow + 1 Next End If -- Les |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
in your code you have this line:
vPrtNums = frm_InputTM.txt_PrtNumber should you also have a line for the sPrtDescr variable?: sPrtDescr = frm_InputTM.txt_PrtDescr J On 14 Sep, 12:40, Les wrote: Hi all, i have created the code below to loop through all the part numbers intererd into txt_PrtNumber, this is working fine, but now i need to add the part description as well, i am baffled here and do not know what to do. Any help would be much appreciated. Dim vPrtNums As String, lmyAdd As Variant Dim MyNums As Variant, sPrtDescr As String, myDescr As Variant Dim i, d vPrtNums = frm_InputTM.txt_PrtNumber i = Split(vPrtNums, ",") MyNums = i * * If frm_InputTM.Opt_SevPartsOneSupp = True Then * * * * For Each i In MyNums * * * * * * If i = "" Then * * * * * * Else * * * * * * * * With ActiveWorkbook.ActiveSheet * * * * * * * * * * Range(vmyCol & vmyRow) = i * * * * * * * * * * Range(vmyCol & vmyRow).Offset(0, 4) = sPrtDescr * * * * * * * * * * Range(vmyCol & vmyRow).Offset(0, 5) = sModel * * * * * * * * End With * * * * * * End If * * * * * * vmyRow = vmyRow + 1 * * * * Next * *End If -- Les |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Create loop to insert two rows after every row of data | Excel Programming | |||
Insert Data Last Row Loop through cells Excel 2000 & 2003 | Excel Programming | |||
Using Loop to insert a row | Excel Programming | |||
Data Form Insert Count to add to Summary Sheet | Excel Programming | |||
Cant run insert row through loop | Excel Programming |