Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable headers
Hi,
I am trying to convert a file with raw data into a particular format that I can use to upload in a risk model. This model requires a few specific parameters that identify which data (portfolio) it concerns. The parameters have the following format: A B C 1 <portfolio Futures 2 <base currency EUR 3 <date 20071231 4 <ID <IDType <holdings The values between < are default, all others are variable. I already managed to make a statement that subtracts the data based on the above parameters, the only problem I am facing is how to make a command that automatically pastes the above fields in an empty sheet (starting cell A1). As there are multiple portfolios I would need to repeat this action a couple of times so if the command can also include a command that goes to the last rows+1 and then pastes the above parameters again. Does anyone knows a way to capture this in a VBA statement? All suggestions are warmly welcome! Thanks a lot!!! Rgds, Robert |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable headers
Before anyone can answer this for you, it would be good to state where
the data is coming FROM. We know it has to get pasted into a blank sheet .. no problem. But where is it coming from? Different program? Website? Other excel file? Thanks! Chris On Mar 10, 9:11*am, Robert wrote: Hi, I am trying to convert a file with raw data into a particular format that I can use to upload in a risk model. This model requires a few specific parameters that identify which data (portfolio) it concerns. The parameters have the following format: * * * * A * * * * * * * * * * * * * B * * * * * * * * * * C 1 <portfolio * * * * * * * *Futures 2 <base currency * * * EUR 3 <date * * * * * * * * * * 20071231 4 <ID * * * * * * * * * * * *<IDType * * * * *<holdings The values between < are default, all others are variable. I already managed to make a statement that subtracts the data based on the above parameters, the only problem I am facing is how to make a command that automatically pastes the above fields in an empty sheet (starting cell A1). As there are multiple portfolios I would need to repeat this action a couple of times so if the command can also include a command that goes to the last rows+1 and then pastes the above parameters again. Does anyone knows a way to capture this in a VBA statement? All suggestions are warmly welcome! Thanks a lot!!! Rgds, Robert |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable headers
The date would be in sheet: Parameters, Cell:D4
HTH |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable headers
ActiveWorkbook.Worksheets.Add.Name = "NewSheet"
Sheets("NewSheet").Move After:=Sheets(ActiveWorkbook.Worksheets.Count) 'Copy and paste Sheets("Parameters").Activate Range("D4:F7").Select Selection.Copy Sheets("NewSheet").Activate Cells(1, 1).Select do until activecell = "" activecell.offset(1,0).select loop ActiveSheet.Paste That should work I think .... let me know. Chris On Mar 10, 10:35*am, Robert wrote: The date would be in sheet: Parameters, Cell:D4 HTH |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
lookup using column headers and row headers | Excel Discussion (Misc queries) | |||
Hide Column Headers but not row (Headers) | Excel Programming | |||
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? | Excel Worksheet Functions | |||
Run-time error '91': "Object variable or With block variable not set | Excel Programming | |||
Cells.Find error Object variable or With block variable not set | Excel Programming |