Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Attached is my currect macro is adding two characters in the front would it
be possible to add three characters in the back also? Sub Goodman2() Const Summaryworkbook = "GOODMAN OPEN ITEMS.xls" Const MainInvoiceCol = 2 Const MainPasteCol = 22 Const wbkInvoiceCol = 5 Const wbkStartCol = 1 Const wbkEndCol = 14 Dim i As Integer Set wsh1 = Workbooks(Summaryworkbook).Worksheets(1) wsh1.Activate Lastrow = wsh1.Cells(Rows.Count, MainInvoiceCol).End(xlUp).Row Set InvoiceRange = wsh1. _ Range(Cells(1, MainInvoiceCol), Cells(Lastrow, MainInvoiceCol)) For Each cell1 In InvoiceRange InvoiceNumber = cell1.Value i = Len(InvoiceNumber) i = i + 2 InvoiceNumber = Right(InvoiceNumber, i) For Each wbk1 In Application.Workbooks If StrComp(wbk1.Name, Summaryworkbook) < 0 Then With wbk1.Worksheets(1) .Activate Lastrow = .Cells(Rows.Count, wbkInvoiceCol).End(xlUp).Row Set InvoiceRange2 = .Range(Cells(1, wbkInvoiceCol), Cells(Lastrow, wbkInvoiceCol)) For Each Cell2 In InvoiceRange2 If (Cell2.Value = "CM" & InvoiceNumber) Then .Range(Cells(Cell2.Row, wbkStartCol), _ Cells(Cell2.Row, wbkEndCol)).Copy _ Destination:=wsh1.Cells(cell1.Row, MainPasteCol) End If Next Cell2 End With End If Next wbk1 Next cell1 End Sub -- Message posted via http://www.officekb.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Printing a two spreadsheets front and back | Excel Discussion (Misc queries) | |||
print front and back | Excel Worksheet Functions | |||
Excel Front end Acces Back end | Excel Discussion (Misc queries) | |||
Replacing last 3 characters and adding them to front | Excel Discussion (Misc queries) | |||
move '-' from back to front??? | Excel Programming |