Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
DDE Data Streaming Macro
' Hello, 'I am having problems that I hope you all can give some advice on 'I am trying to set this up so it can easily be positioned in any column by changing initialOffset. 'The first problem I am having is that when I do that regardless of where I set the ' initial offset it only works in col A<nn and B<n with initialOffset set to 0 'With initialOffset set to 1, entering data into b1 and c1 and it is not reliable and somtimes will acknowledge the data in b1 but does not see the data in c1 and I get the itype not found error it wil find the text entered Col B1 but not the type in Col C1. 'and what really gets me is that I can use any number for the write to spreadsheet 'and it offsets perfectly 'I cannot find what is different except one is a write and the other an entry. ' ' 'Another problem is that I want this streaming data to also fill on another sheet 'I have tried a few things but did not have much luck and my methods gave 'unreliable results Sub requestData() ' description vars Dim name As String Dim iType As String ' get description Const initialOffset = 0 name = UCase(ActiveCell.offset(0, initialOffset + 0).Value) iType = UCase(ActiveCell.offset(0, initialOffset + 1).Value) ' must have symbol, secType If name = "" Then Beep MsgBox ("enter name") Exit Sub End If If iType = "" Then Beep MsgBox ("enter iTYPE.") Exit Sub End If ' Place in spreadsheet Const reqOffset = 10 + initialOffset ActiveCell.offset(0, reqOffset + 1).Value = name ActiveCell.offset(0, reqOffset + 2).Value = iType ActiveCell.offset(1, 0).Activate End Sub -- rnrss ------------------------------------------------------------------------ rnrss's Profile: http://www.excelforum.com/member.php...o&userid=27823 View this thread: http://www.excelforum.com/showthread...hreadid=474208 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
DDE Data Streaming Macro
If at first you do not get an answer try adding more info not just reposting
the same quick read: Const reqOffset = 10 + initialOffset why are you trying to set a constant = a variable??? try reqOffset = 10 + initialOffset also I don't use UCase for things like this just put OPTION COMPARE TEXT at the very top of the module and all code will ignore case in text comparisons. IF you repost: What happened? What did tou expect to happen? Try to limit to one part of the problem per posting, easier to fix one piece at a time. "rnrss" wrote: ' Hello, 'I am having problems that I hope you all can give some advice on 'I am trying to set this up so it can easily be positioned in any column by changing initialOffset. 'The first problem I am having is that when I do that regardless of where I set the ' initial offset it only works in col A<nn and B<n with initialOffset set to 0 'With initialOffset set to 1, entering data into b1 and c1 and it is not reliable and somtimes will acknowledge the data in b1 but does not see the data in c1 and I get the itype not found error it wil find the text entered Col B1 but not the type in Col C1. 'and what really gets me is that I can use any number for the write to spreadsheet 'and it offsets perfectly 'I cannot find what is different except one is a write and the other an entry. ' ' 'Another problem is that I want this streaming data to also fill on another sheet 'I have tried a few things but did not have much luck and my methods gave 'unreliable results Sub requestData() ' description vars Dim name As String Dim iType As String ' get description Const initialOffset = 0 name = UCase(ActiveCell.offset(0, initialOffset + 0).Value) iType = UCase(ActiveCell.offset(0, initialOffset + 1).Value) ' must have symbol, secType If name = "" Then Beep MsgBox ("enter name") Exit Sub End If If iType = "" Then Beep MsgBox ("enter iTYPE.") Exit Sub End If ' Place in spreadsheet Const reqOffset = 10 + initialOffset ActiveCell.offset(0, reqOffset + 1).Value = name ActiveCell.offset(0, reqOffset + 2).Value = iType ActiveCell.offset(1, 0).Activate End Sub -- rnrss ------------------------------------------------------------------------ rnrss's Profile: http://www.excelforum.com/member.php...o&userid=27823 View this thread: http://www.excelforum.com/showthread...hreadid=474208 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
DDE Data Streaming Macro
Thanks for the info! I am trying to change the position: left to right on both the type input data and also the output stream by changing a single number tha remains constant and is only changed should I change the layou format. I also need the output to be caps. The output offsets perfectly however the input does not, using the sam technique. I am not sure what is happening to the input, so I file several cells to see which it picked up... Here is a pic: http://i22.photobucket.com/albums/b3...ffsetissue.jpg I changed the program as you suggested, removing Ucase and it no longe gave me caps on the output so I put them back in. I left the optio compare in at this point. To get this to output I select the name cell and hit run and it output the selected cell and uses that as the starting point to place that on and all others to their specified location. an offset of 0 is col a and an offset of 1 should be col b Removing the constant helped, it seems to be stable now however when enter an offset of 1 it picks cell 1+1 for the input... cellB + 1 o cell C... the cyan cells are where I placed the cursor and the yellow is wha actually was outputted... Option Compare Text Dim genId As Integer Sub requestData() ' description vars Dim name As String Dim iType As String ' get description initialOffset = 1 name = UCase(ActiveCell.offset(0, initialOffset + 0).Value) iType = UCase(ActiveCell.offset(0, initialOffset + 1).Value) ' must have symbol, secType If name = "" Then Beep MsgBox ("enter name") Exit Sub End If If iType = "" Then Beep MsgBox ("enter iTYPE.") Exit Sub End If ' Place in spreadsheet reqOffset = initialOffset + 10 ActiveCell.offset(0, reqOffset + 1).Value = name ActiveCell.offset(0, reqOffset + 2).Value = iType ActiveCell.offset(1, 0).Activate End Su -- rnrs ----------------------------------------------------------------------- rnrss's Profile: http://www.excelforum.com/member.php...fo&userid=2782 View this thread: http://www.excelforum.com/showthread.php?threadid=47420 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Chart Streaming? | Charts and Charting in Excel | |||
streaming csv data | Excel Discussion (Misc queries) | |||
How freeze streaming data at specific point in time? | Excel Discussion (Misc queries) | |||
Compare cells using real time streaming data | Excel Programming | |||
Updating High/Low Values from a set of streaming data | Excel Programming |