Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel Vba Programming


Hi!
i have two workbooks. form one work book column 22 to import another
work book column 12 depending upon the company name in work book 2.
here is the code. it does not work. could you correct the code .
my email address is


ub MoveSupporttoInv()
Application.ScreenUpdating = False
Dim i As Long
Dim mycompany
Dim contracttype
Dim CONTRACTTYPE1
Dim ORIGINALEXPIRATION
Dim TERMTYPE
Dim NOTICEPERIOD
Dim RENEWALINTERVAL
Dim IMPLEMENTAIONEXCEPTION
Dim CIBCLegalEntity
Dim Contractmanager
Dim businessunit
Dim contractgroup

Windows("License___Support___09_29_05 2 .xls").Activate ''Change to
new workbk name
'Sheets("License & support").Activate
For i = Range("a65536").End(xlUp).Row To 5 Step -1

mycompany = Cells(i, 1).Text
contracttype = Cells(i, 6).Text
CIBCLegalEntity = Cells(i, 5).Text
CONTRACTTYPE1 = Cells(i, 7).Text
ORIGINALEXPIRATION = Cells(i, 12).Text
TERMTYPE = Cells(i, 13).Text
NOTICEPERIOD = Cells(i, 14).Text
RENEWALINTERVAL = Cells(i, 15).Text
IMPLEMENTAIONEXCEPTION = Cells(i, 17).Text
Contractmanager = Cells(i, 21).Text
businessunit = Cells(i, 20).Text
Windows("MASTER.xls").Activate ''CHANGE THIS TO NEW WKBOOK
On Error Resume Next
Range("A:A").Cells.Find(What:=mycompany, LookIn:=xlValues,
LookAt:=xlWhole).Select
If Err = 91 Then
Windows("License___Support___09_29_05 2 .xls").Activate
''Change to new workbk name
ElseIf mycompany < "" Then
ActiveCell.Offset(, 12).Value = contractgroup
'ActiveCell.Offset(, 6).Value = CONTRACTTYPE1
'If ActiveCell.Offset(, 8).Text < CIBCLegalEntity Then
' ActiveCell.Offset(, 8).Value = CIBCLegalEntity
' Else
' ActiveCell.Offset(, 8).Value = CIBCLegalEntity
End If
'ActiveCell.Offset(, 14).Value = ORIGINALEXPIRATION
'ActiveCell.Offset(, 15).Value = TERMTYPE
'ActiveCell.Offset(, 16).Value = NOTICEPERIOD
'ActiveCell.Offset(, 17).Value = RENEWALINTERVAL
' ActiveCell.Offset(, 20).Value = IMPLEMENTAIONEXCEPTION
'ActiveCell.Offset(, 39).Value = Contractmanager
'ActiveCell.Offset(, 40).Value = businessunit
Windows("License & support - 8.17.05").Activate ''Change to
new workbk name
'End If
Windows("License___Support___09_29_05 2 .xls").Activate
''Change to new workbk name
Next
End Sub


--
kamakshi
------------------------------------------------------------------------
kamakshi's Profile:
http://www.excelforum.com/member.php...o&userid=27714
View this thread: http://www.excelforum.com/showthread...hreadid=472305

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Excel Vba Programming

Why did you start a new post? Your last post about this same problem was just an hour ago and you were getting help from a very
knowledgeable person. Please keep your post for the same issue in the same post until it has been reasonably exhausted. This is kind
of an insult to Bob by just dismissing his attempt to help you and reposting an hour later. If you can't wait your turn then you
should figure out your own answer. Bob was trying to help you, and others might have also if you would have just replied that the
code he gave didn't work. We can't just snap our fingers and solve your problems immediately. Be considerate of those who try to
help you in these forums.

Thank you for your future considerate behavior.
--
RMC,CPA


"kamakshi" wrote in message
...

Hi!
i have two workbooks. form one work book column 22 to import another
work book column 12 depending upon the company name in work book 2.
here is the code. it does not work. could you correct the code .
my email address is


ub MoveSupporttoInv()
Application.ScreenUpdating = False
Dim i As Long
Dim mycompany
Dim contracttype
Dim CONTRACTTYPE1
Dim ORIGINALEXPIRATION
Dim TERMTYPE
Dim NOTICEPERIOD
Dim RENEWALINTERVAL
Dim IMPLEMENTAIONEXCEPTION
Dim CIBCLegalEntity
Dim Contractmanager
Dim businessunit
Dim contractgroup

Windows("License___Support___09_29_05 2 .xls").Activate ''Change to
new workbk name
'Sheets("License & support").Activate
For i = Range("a65536").End(xlUp).Row To 5 Step -1

mycompany = Cells(i, 1).Text
contracttype = Cells(i, 6).Text
CIBCLegalEntity = Cells(i, 5).Text
CONTRACTTYPE1 = Cells(i, 7).Text
ORIGINALEXPIRATION = Cells(i, 12).Text
TERMTYPE = Cells(i, 13).Text
NOTICEPERIOD = Cells(i, 14).Text
RENEWALINTERVAL = Cells(i, 15).Text
IMPLEMENTAIONEXCEPTION = Cells(i, 17).Text
Contractmanager = Cells(i, 21).Text
businessunit = Cells(i, 20).Text
Windows("MASTER.xls").Activate ''CHANGE THIS TO NEW WKBOOK
On Error Resume Next
Range("A:A").Cells.Find(What:=mycompany, LookIn:=xlValues,
LookAt:=xlWhole).Select
If Err = 91 Then
Windows("License___Support___09_29_05 2 .xls").Activate
''Change to new workbk name
ElseIf mycompany < "" Then
ActiveCell.Offset(, 12).Value = contractgroup
'ActiveCell.Offset(, 6).Value = CONTRACTTYPE1
'If ActiveCell.Offset(, 8).Text < CIBCLegalEntity Then
' ActiveCell.Offset(, 8).Value = CIBCLegalEntity
' Else
' ActiveCell.Offset(, 8).Value = CIBCLegalEntity
End If
'ActiveCell.Offset(, 14).Value = ORIGINALEXPIRATION
'ActiveCell.Offset(, 15).Value = TERMTYPE
'ActiveCell.Offset(, 16).Value = NOTICEPERIOD
'ActiveCell.Offset(, 17).Value = RENEWALINTERVAL
' ActiveCell.Offset(, 20).Value = IMPLEMENTAIONEXCEPTION
'ActiveCell.Offset(, 39).Value = Contractmanager
'ActiveCell.Offset(, 40).Value = businessunit
Windows("License & support - 8.17.05").Activate ''Change to
new workbk name
'End If
Windows("License___Support___09_29_05 2 .xls").Activate
''Change to new workbk name
Next
End Sub


--
kamakshi
------------------------------------------------------------------------
kamakshi's Profile:
http://www.excelforum.com/member.php...o&userid=27714
View this thread: http://www.excelforum.com/showthread...hreadid=472305


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Programming danjordan2000 Excel Discussion (Misc queries) 1 November 17th 08 01:20 PM
Excel programming Jenny G. Excel Programming 5 April 6th 05 02:24 PM
VBA excel programming VBANewcomer Excel Programming 2 December 10th 04 08:19 PM
Excel Programming Geoff D'Arcy Excel Programming 2 November 1st 04 12:07 PM
Excel Programming Help Jason Excel Programming 1 July 7th 04 02:50 AM


All times are GMT +1. The time now is 02:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"