Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Import matching up the Headers name instead of the Column letter


With Workbooks(MyFile).Worksheets("Trade Report")

If Trim(.Range("W" & unaplRow)) = "Purchase" Then 'Or Trim(.Range("R" &
unaplRow)) = "961011" Then
ThisWorkbook.Worksheets("TransactionsBuys").Activa te

ThisWorkbook.Worksheets("TransactionsBuys").Range( "F" & MastRow) =
C_Code(.Range("X" & unaplRow))

'ThisWorkbook.Worksheets("TransactionsBuys").Range ("F" & mastRow) = "20955"
'ExecBroker

ThisWorkbook.Worksheets("TransactionsBuys").Range( "A" & MastRow) = StrRegion
'Region

ThisWorkbook.Worksheets("TransactionsBuys").Range( "B" & MastRow) =
Trim(.Range("J" & unaplRow)) 'Fund

ThisWorkbook.Worksheets("TransactionsBuys").Range( "C" & MastRow) =
"=RIGHT(RC[-1],3)" ' Abbr fund

ThisWorkbook.Worksheets("TransactionsBuys").Range( "D" & MastRow) =
Trim(.Range("L" & unaplRow)) 'Cusip or AssetID
'Column E is Blank becuase there is no AssetCode

ThisWorkbook.Worksheets("TransactionsBuys").Range( "G" & MastRow) =
Format(Trim(.Range("R" & unaplRow)), "yymmdd") 'trade Date

ThisWorkbook.Worksheets("TransactionsBuys").Range( "H" & MastRow) =
Format(Trim(.Range("S" & unaplRow)), "yymmdd")

ThisWorkbook.Worksheets("TransactionsBuys").Range( "I" & MastRow) = Today

ThisWorkbook.Worksheets("TransactionsBuys").Range( "J" & MastRow) =
StrSettleLoc

ThisWorkbook.Worksheets("TransactionsBuys").Range( "K" & MastRow) =
Format(Trim(.Range("P" & unaplRow)), "00.00")

ThisWorkbook.Worksheets("TransactionsBuys").Range( "U" & MastRow) = StrInterest

ThisWorkbook.Worksheets("TransactionsBuys").Range( "V" & MastRow) =
Format(Trim(.Range("C" & unaplRow)), "00.00")

ThisWorkbook.Worksheets("TransactionsBuys").Range( "AC" & MastRow) = StrPAOnly

ThisWorkbook.Worksheets("TransactionsBuys").Range( "AU" & MastRow) =
StrIssueClass

MastRow = MastRow + 1
End If
End With
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Import matching up the Headers name instead of the Column letter


Yes, if header is in row 1 and is called ABC then

with ThisWorkbook.Worksheets("TransactionsBuys")
set c = .rows(1).find(what:="ABC", lookin:=xlvalues, lookat:=xlwhole)
if c is nothing then
msgbox("Could not find header : " & "ABC")
else
.Cells(MastRow, c.column) = C_Code(.Range("X" & unaplRow))
end if
end with

"Crazyhorse" wrote:

With Workbooks(MyFile).Worksheets("Trade Report")

If Trim(.Range("W" & unaplRow)) = "Purchase" Then 'Or Trim(.Range("R" &
unaplRow)) = "961011" Then
ThisWorkbook.Worksheets("TransactionsBuys").Activa te

ThisWorkbook.Worksheets("TransactionsBuys").Range( "F" & MastRow) =
C_Code(.Range("X" & unaplRow))

'ThisWorkbook.Worksheets("TransactionsBuys").Range ("F" & mastRow) = "20955"
'ExecBroker

ThisWorkbook.Worksheets("TransactionsBuys").Range( "A" & MastRow) = StrRegion
'Region

ThisWorkbook.Worksheets("TransactionsBuys").Range( "B" & MastRow) =
Trim(.Range("J" & unaplRow)) 'Fund

ThisWorkbook.Worksheets("TransactionsBuys").Range( "C" & MastRow) =
"=RIGHT(RC[-1],3)" ' Abbr fund

ThisWorkbook.Worksheets("TransactionsBuys").Range( "D" & MastRow) =
Trim(.Range("L" & unaplRow)) 'Cusip or AssetID
'Column E is Blank becuase there is no AssetCode

ThisWorkbook.Worksheets("TransactionsBuys").Range( "G" & MastRow) =
Format(Trim(.Range("R" & unaplRow)), "yymmdd") 'trade Date

ThisWorkbook.Worksheets("TransactionsBuys").Range( "H" & MastRow) =
Format(Trim(.Range("S" & unaplRow)), "yymmdd")

ThisWorkbook.Worksheets("TransactionsBuys").Range( "I" & MastRow) = Today

ThisWorkbook.Worksheets("TransactionsBuys").Range( "J" & MastRow) =
StrSettleLoc

ThisWorkbook.Worksheets("TransactionsBuys").Range( "K" & MastRow) =
Format(Trim(.Range("P" & unaplRow)), "00.00")

ThisWorkbook.Worksheets("TransactionsBuys").Range( "U" & MastRow) = StrInterest

ThisWorkbook.Worksheets("TransactionsBuys").Range( "V" & MastRow) =
Format(Trim(.Range("C" & unaplRow)), "00.00")

ThisWorkbook.Worksheets("TransactionsBuys").Range( "AC" & MastRow) = StrPAOnly

ThisWorkbook.Worksheets("TransactionsBuys").Range( "AU" & MastRow) =
StrIssueClass

MastRow = MastRow + 1
End If
End With

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
how do I change column headers from a number to a letter niffer Excel Discussion (Misc queries) 2 October 11th 07 04:27 PM
how do I change column headers from a number to a letter niffer Excel Discussion (Misc queries) 1 October 11th 07 04:14 PM
wise ass who changed column headers to numbers instead of letter SteveG Excel Discussion (Misc queries) 0 December 28th 05 03:19 PM
How to replace column letter in refferences with a function using the old column letter? Dmitry Kopnichev Links and Linking in Excel 6 October 13th 05 09:09 AM
How to replace column letter in refferences with a function using the old column letter? Dmitry Kopnichev Excel Worksheet Functions 6 October 13th 05 09:09 AM


All times are GMT +1. The time now is 03:36 AM.

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

About Us

"It's about Microsoft Excel"