Thread Rating:
• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 Using getsel Tyler5248 Junior Member Posts: 2 Threads: 1 Joined: Sep 2017 Reputation: 0 09-15-2017, 03:53 PM I am working with a program that I is tabled out but it isn't like excel where cells can be indetified as column/row (ie. "A1, A2.."). I am trying to right a macro to take the cell that I am currently in, copy the contents to a variable and then evaluate the variable, use left arrow to move over a cell and then paste out the resulting contents from the evaluation. See my code below and please help me. Thank you, #region Recorded 9/14/2017 4:33:53 PM int w1=act(win("Costing Template Editor - Jones machining template(metric) TYLER.sldctm" "#32770")) double i = 1 double A =1 double B =76.2 rep (1) str s.getsel if x>=0 and x<=3.175 A = 0.0127 else if x>=3.175 and x<=6.35 A = 0.0254 else if x>=6.35 and x<=12.7 A = 0.0508 else if x>=12.7 and x<=19.05 A = 0.0889 else if x>=19.05 and x<=25.4 A = 0.1397 else A = 0.1905 'R 'F"{A}" 'R 'F"{B}" 'R 'D 'L 'L 'L #endregion Gintaras Administrator Posts: 10,429 Threads: 121 Joined: Dec 2002 Reputation: 0 09-15-2017, 08:10 PM double x = val(s 2) Tyler5248 Junior Member Posts: 2 Threads: 1 Joined: Sep 2017 Reputation: 0 09-18-2017, 04:34 PM #region Recorded 9/14/2017 4:33:53 PM int w1=act(win("Costing Template Editor - Jones machining template(metric) TYLER.sldctm" "#32770")) double i = 1 double A =1 double B =76.2 rep (1) str s.getsel double x=val(s 2) if x>=0 and x<=3.175 A = 0.0127 else if x>=3.175 and x<=6.35 A = 0.0254 else if x>=6.35 and x<=12.7 A = 0.0508 else if x>=12.7 and x<=19.05 A = 0.0889 else if x>=19.05 and x<=25.4 A = 0.1397 else A = 0.1905 'R 'F"{A}" 'R 'F"{B}" 'R 'D 'L 'L 'L out x #endregion When I run this is states my x =0 Gintaras Administrator Posts: 10,429 Threads: 121 Joined: Dec 2002 Reputation: 0 09-18-2017, 05:13 PM If s is like "0,5", replace "," with ".". out s s.findreplace("," ".") out s « Next Oldest | Next Newest »

Forum Jump:

Users browsing this thread: 1 Guest(s)