D
David Langschied
This, I thought, was going to be easy and have not figured it out.
I am inputing a row of data from one worksheet to another. I want to add a
new column that contains the number of the row just created by the data.
So...
Sub Otros_XXXX_Cuenta()
'Select Transaction Sheet
Sheets("Hoja_de_seleccion_de_trans").Select
'Store the row information to be copied From the transaction worksheet
'at global RowNum
cellrange = "B" + CStr(rownum) + ":" + "P" + CStr(rownum)
'Increment the Otros Row Number
rownumO = rownumO + 1
'Select the row to import into Otros
Range(cellrange).Select
'Setup the selection copy
Application.CutCopyMode = False
Selection.Copy
'Setup the paste
Sheets("Otros_HSBC_Cuenta").Select
Range("A" + CStr(rownumO)).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
'Add new row for row number value
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
'Select the cell to update
Range("A1").Select
'Update cell with row number
Range("A" + CStr(rownum)).Value = rownumO
'Go Back to transaction sheet
Sheets("Hoja_de_seleccion_de_trans").Select
End Sub
I tried the update above, I tried using cell.value and I keep getting
errors. It is probably really simple, but I cannot figure it out.
I am inputing a row of data from one worksheet to another. I want to add a
new column that contains the number of the row just created by the data.
So...
Sub Otros_XXXX_Cuenta()
'Select Transaction Sheet
Sheets("Hoja_de_seleccion_de_trans").Select
'Store the row information to be copied From the transaction worksheet
'at global RowNum
cellrange = "B" + CStr(rownum) + ":" + "P" + CStr(rownum)
'Increment the Otros Row Number
rownumO = rownumO + 1
'Select the row to import into Otros
Range(cellrange).Select
'Setup the selection copy
Application.CutCopyMode = False
Selection.Copy
'Setup the paste
Sheets("Otros_HSBC_Cuenta").Select
Range("A" + CStr(rownumO)).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
'Add new row for row number value
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
'Select the cell to update
Range("A1").Select
'Update cell with row number
Range("A" + CStr(rownum)).Value = rownumO
'Go Back to transaction sheet
Sheets("Hoja_de_seleccion_de_trans").Select
End Sub
I tried the update above, I tried using cell.value and I keep getting
errors. It is probably really simple, but I cannot figure it out.