Programming

52K

Solutions

40K

Contributors

Programming includes both the specifics of the language you’re using, like Visual Basic, .NET, Java and others, but also the best practices in user experience and interfaces and the management of projects, version control and development. Other programming topics are related to web and cloud development and system and hardware programming.

Share tech news, updates, or what's on your mind.

Sign up to Post

Columns("B:H").Select
    Selection.Delete Shift:=xlToLeft

I used above code to select columns from B to H and delete it. But its getting select from A to I and deleting all from A-I.

Please advise me code correction.
0
Introducing Priority Question
LVL 9
Introducing Priority Question

Increase expert visibility of your issues by participating in Priority Question, our latest feature for Premium and Team Account holders. Adjust the priority of your question to get emergent issues in front of subject-matter experts for help when you need it most.

Hi

I need to create an Excel CSV file.  This CSV file has a column of large numbers .....  example 2100000000003   .

I wish for the numbers to be represented in full view.   I need to see the full number so that I know that each number is unique.
 Excel insists on changing the  number to scientific notation.  Of course, they all look the same then.

The application accepting this CSV file will read the numbers as text,

Question... How do I save the CSV file so that I open it again,  I will see the full number instead of the scientific notation representation.

Thank you.
0
Hi,

while creating client from wsdl using web servicesw getting below error




public class CustomerOrdersWS {

      public static void main(String[] args) {
            // TODO Auto-generated method stub
            CustomerOrdersService service=new CustomerOrdersService(new URL{"http://localhost:8080/wsdlfirstws/services/customerOrders?wsdl"});
            

      }

}




Multiple markers at this line
      - Type mismatch: cannot convert from String[] to
       CustomerOrdersService
      - Syntax error on token(s), misplaced construct(s)
      - Syntax error on token ")", delete this token

i wonder what it mean by above error and how to resolve it please advise
0
Hello again!

I'm trying to find some sort of tutorial, or other information on the proper syntax and such for Nessus .audit files, specifically for Cisco products.

The "Nessus Compliance Reference" on Tenable's website doesn't explain nearly well enough the different meta-characters and their uses (I.E. ^, $, bracketing), nor does it explain how Nessus looks at IF/OR/AND statements.

Any help would be greatly appreciated!

EDIT: To explain better.

I understand the basic syntax:
<check_type: "Cisco"> 
  <item>
    type       : CONFIG_CHECK
    description: "Enable password is set and encrypted"
    info       : "Check to see if the enable password is encrypted"
    item       : "enable secret [^ ]+"
    required   : YES
    severity   : HIGH
  </item>
</check_type>

Open in new window


But the part on line 6 after ENABLE SECRET is part of what I don't understand (I am having to rewrite an .audit file to suit my organization's needs).

Another example of stuff that I'm attempting to do, but not understanding how:
<if>
  <condition type:"OR">
    <item>
      type        : CONFIG_CHECK
      description : "Check for aaa auth login default"
      info        : "The network element must have DNS servers defined if it is configured as a client resolver."
      item        : "ip domain-lookup"
      item        : "ip name-server [^ ]+"
      severity    : MEDIUM
    </item>
    <item>
      type        : CONFIG_CHECK
      description : "Check for aaa auth login default"
      info        : "The network element must have DNS servers defined if it is configured as a client resolver."
      item        : "no ip domain-lookup"
      severity    : MEDIUM
    </item>
  </condition>

Open in new window


What I'm aiming for is that if either one of those checks is positive, then the system has passed that particular audit, as both of those will meet the requirements.
0
Hi Experts!

I want to adjust the width of the all the columns from C2 up to the last column
these are my code

Dim LastColumn As Long
LastColumn = ActiveSheet.UsedRange.Columns(ActiveSheet.UsedRange.Columns.Count).Column
Columns("C2", LastColumn).EntireColumn.AutoFit

My problem is
  A.   I have a run -time error on this part
  Columns("C2", LastColumn).EntireColumn.AutoFit
  B.   I have a group cells and I want it to remain it group as I autofit all the cells
0
I'm trying to write a program that remains responsive when it's performing some ftp operations.  Do I use Parallel Programming or Async/Await to make the happen?

Can you provide an example?
0
I have a lot of rows of data and what I'm looking for is on columns G and H I wanted to highlight the entire row red (bad) if the date on Column H is greater than the date on Column G  AND only those red ones imported to a sheet called PASS_DUE_REPORT.

See attachment for what it should look like.  Thank you.....
C--Users-lfreund-Desktop-DATES.xlsx
0
Can you please help me regarding all the cells?
What I want is To highlight cell form range ("C7" to the last row )

this is my code

Dim LastRow
LastRow = ActiveSheet.UsedRange.Rows.Count
    Dim x As Range
' How can I declare a range  from the Range ("C6 up to the last row of KHL") not just 50
    Set x = Worksheets("Product").Range("C6:KHL50").Cells
    Dim sRange As Range
How can I declare a range  from the Range ("A6 up to the last row of B") not just 100
    Set sRange = Range("A6:B100")
    Application.ScreenUpdating = False
    With ActiveCell
        If InRange(ActiveCell, sRange) Then
          MsgBox ("Cannot Mark This Area")
        Else
        ' Highlight the entire sheets that contain the active cell
          x.Interior.Color = RGB(255, 255, 0)
          sRange.Interior.ColorIndex = xlNone
       End If
    End With
  Application.ScreenUpdating = True
0
http://codingbat.com/prob/p126332

public Map<String, String> pairs(String[] strings) {
  Map map=new HashMap();
  for(String str:strings){
    int len=str.length();
    map.put(str.substring(0,1), str.substring(len-1,len));
  }
  return map;
}

Open in new window

xpected      Run            
pairs(["code", "bug"]) → {"b": "g", "c": "e"}      {"b": "g", "c": "e"}      OK      
pairs(["man", "moon", "main"]) → {"m": "n"}      {"m": "n"}      OK      
pairs(["man", "moon", "good", "night"]) → {"g": "d", "m": "n", "n": "t"}      {"g": "d", "m": "n", "n": "t"}      OK      
pairs([]) → {}      {}      OK      
pairs(["a", "b"]) → {"a": "a", "b": "b"}      {"a": "a", "b": "b"}      OK      
pairs(["are", "codes", "and", "cods"]) → {"a": "d", "c": "s"}      {"a": "d", "c": "s"}      OK      
pairs(["apple", "banana", "tea", "coffee"]) → {"a": "e", "b": "a", "c": "e", "t": "a"}      {"a": "e", "b": "a", "c": "e", "t": "a"}      OK      
other tests
OK      

I wrote as above and passing all steps. Any improvements to my code. please advise
0
http://codingbat.com/prob/p152303
For above challenge i wrote my code like below and passing all tests
public Map<String, Integer> word0(String[] strings) {
 
Map<String, Integer> map=new HashMap<String, Integer>();

for(String string : strings){
  map.put(string,0);
    map.put(string,0);
}
return map;
}

Open in new window

Expected      Run            
word0(["a", "b", "a", "b"]) → {"a": 0, "b": 0}      {"a": 0, "b": 0}      OK      
word0(["a", "b", "a", "c", "b"]) → {"a": 0, "b": 0, "c": 0}      {"a": 0, "b": 0, "c": 0}      OK      
word0(["c", "b", "a"]) → {"a": 0, "b": 0, "c": 0}      {"a": 0, "b": 0, "c": 0}      OK      
word0(["c", "c", "c", "c"]) → {"c": 0}      {"c": 0}      OK      
word0([]) → {}      {}      OK      
other tests
OK      
any improvements to my code. please advise
0
Free Tool: Subnet Calculator
LVL 9
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

I'm programming Infineon TC29x Aurix Tricore Microcontroller based embedded system in 'C' language.
 
Consider stack starting at address 0x5000 0000.  The stack size is 0x1000.  

If I add 0x1000 to current stack pointer(Register A10) and store result in A10, then I should get underflow error.

What might be the code in assembly to change stack pointer?  something like following:

stw a10, 0x1000(a10)   # I'm not sure if stw is correct opcode ?

what are other options to create stack undeflow exception?
0
We need to extract a table from a PDF document into Excel and clean it up by moving columns around and deleting unnecessary rows, and then paste the results into a new Word file. This task is done several times weekly, so we would like to create a macro to automate the task.

Details:
  1. The number of columns in Excel, and their position in the table may vary, but the column headings that we need are always named the same.
  1. The Excel table will always reside in Sheet2.

Macro steps;
  1. Move Column called IDENT to right of Column called NAME
  1. Move Column called TYPE to right of Column called IDENT
  1. Move Column called LATITUDE to right of Column called TYPE
  1. Move Column called LONGITUDE to right of Column called LATITUDE
  1. Remove all remaining columns to right of LONGITUDE that contain data
  1. Under Column B (NAME) find first row with "-" in cell, and delete this entire row and all subsequent entire rows to last row containing any data
  1. Copy the table, and then paste `as text only`, into a new Word file

I have attached a sample of the Excel table pre-cleanup.

Thanks!
Andrea
EE_Table_Cleanup.xlsx
0
Hello,

I have a small company and I use Excel to generate invoices using a template. I need to print Original as well as a Duplicate invoice every time I print an invoice. I have managed to use the below script and its working fine when I print it directly  to the physical printer. But in case I need to save it as PDF using Adobe PDF or Cute PDF Writer as my default printer,  the app prompts me for a file name at each page. Is there a way where in this can be achieved in a better way and this macro works even when i save it as pdf ? Is there a better way out to achieve what I am wanting to do. Can there be buttons like "Print Original"and a button "Print Duplicate".

PL not that I am not a pro in scripting but just manage to get things done.

Below is the macro I am using :

Sub PrintOrginalDuplicate()
ActiveSheet.PageSetup.RightHeader = "ORIGINAL COPY"
ActiveSheet.PrintOut
ActiveSheet.PageSetup.RightHeader = "DUPLICATE COPY"
ActiveSheet.PrintOut
ActiveSheet.PageSetup.RightHeader = ""
End Sub


Thank you. :)
0
there are some programs that are located in program files and program data and program files x86. is that normal to exist in 3 locations . The file is CARBONITE . Does it need to exist in one location only if so which one . same i noticed with MALWAREBYTES exist in program files and program data. Even though I uninstalled it and put it in the D DRIVE.why is it still showing up in the C DRIVE/ How to get rid of it from C Drive since it is already in The D DRIVE? what is the difference between these 3 locations??
0
I've got an excel spreadsheet with data that looks like this:

LocationNo      DemograpicItem            DemographicTotal
2400200            Building Size                    0
2400200            Indoor Variance            0
2400200            Lot Size                            5043
2400200            Number of Floors         1
2400200            Occupants                    0
2400200            Outdoor Variance              0
2400200            Units                         0
2400202            Building Size                   0
2400202            Indoor Variance            0
2400202            Lot Size                           0
2400202            Number of Floors         1
2400202            Occupants                    0
2400202            Outdoor Variance               0
2400202            Units                           0

I need it to look like:

Location No.     BuildingSize    IndooorVariance    LotSize etc etc
2400200             0                        0                               5043  etc etc
2400202             0                        0                                0


How can I do this via excel or SQL server?  

Thanks
0
In Excel 2016, I'm using VBA to add conditional formatting to certain cells, based on a lookup of target values.  Here's my code:

    thistarget = targets(whichyear, whichquarter, lookup)
    Set myrange = ActiveSheet.Cells(lookup, 4)
    myrange.FormatConditions.Delete
    With myrange
        'if less than or equal to target, color green
        .FormatConditions.Add xlCellValue, xlLessEqual, thistarget
        With .FormatConditions(1)
            .Interior.Color = RGB(146, 208, 80)
            .StopIfTrue = True
        End With
        'if greater than target up to 15% over, color amber
        .FormatConditions.Add xlCellValue, xlBetween, thistarget, (thistarget + 0.15)
        With .FormatConditions(2)
            .Interior.Color = RGB(255, 192, 0)
            .StopIfTrue = True
        End With
        'if more than 15% over target, color red
        .FormatConditions.Add xlCellValue, xlGreater, (thistarget + 0.15)
        With .FormatConditions(3)
            .Interior.Color = vbRed
            .StopIfTrue = True
        End With
    End With

Open in new window

Note that thistarget is dimensioned as a "single" value.  I can stop the code after line 1 and verify that thistarget = 0.63.   So what I expect to see is this:
2 decimalsBut what I actually see is this:
15 decimalsFunctionally it works, but if anybody goes to look at the conditional formatting formulas they are going to think I'm nuts.  

Why is it giving me so many numbers after the decimal?  

By the way, if instead of using a variable I hardcode line 1 to say "thistarget = 0.63" then I get 2 digit precision as expected.
0
Folks,
Open the attached file please, which is the Name Manager for my workbook. Here's my question: Why can't I edit or delete the item selected? This is not true for the last two items below what I have selected.
Name-Manager.png
0
I have a macro that I run on a daily report. Within the macro code, there is a date that needs to be revised every two months for the macro to be effective. I would like to revise a macro if possible so that instead of having to edit the date in the VBA code every publication cycle, that a reference table is included within the VBA code.

The current macro does the following:
  1. Extracts the publication date from the text string in B4 and copies it into $C$5
  1. If date in $B$5 is greater than the hard-coded cut-off date of 19-July-17 at 23:00 hrs AND if $K11 does not equal "89" or "99", then replace contents of $D11 with text string = "LATE". If conditions are not met, then no change to $D11 (original text string retained, or if $D11 was blank, then it remains blank).

Current macro code:
Sub ProMS_Transfer_Late_WOs()
Dim lr As Long
Dim rng As Range, cell As Range
Dim compDate As Date
lr = Cells(Rows.Count, "K").End(xlUp).Row
Set rng = Range("K11:K" & lr)
compDate = DateValue("19 July 2017") + TimeValue("23:00:00")
Columns("B:B").ColumnWidth = 5
Columns("D:D").ColumnWidth = 32.43
Columns("F:F").ColumnWidth = 6
Columns("G:G").ColumnWidth = 42.14
Range("C5").Select
ActiveCell.FormulaR1C1 = "=TEXT(MID(R4C2,169,11),""dd-mmm-yyyy"")"
If Range("c5").Value > compDate Then
    For Each cell In rng
        Cells(cell.Row, "D").Select
        If cell <> 89 And cell <> 99 Then
            Cells(cell.Row, "D") = "LATE"
        End If
    Next cell
End If
End Sub

Open in new window


Desired revisions to current macro:
  1. Determine the Cut-off Date for the Pub Date listed in $C$5 by finding the $C$5 pub date in the Pub Date list (see below)
    1. The Cut-off Date associated with each Pub Date is listed in the column to the right of the Pub Date called Cut-off Date, in the same row
  2. If report 'Execution' date (B5) is > than the determined Cut-off Date at 23:00 hrs AND if $K11 does not equal "89" or "99", then replace contents of $D11 with text string = "LATE". If conditions are not met, then no change to $D11 (original text string retained, or if $D11 was blank, then it remains blank).
0
Hi,

I am expected to propose the EDIFACT solution for a company that starts from scratch (regarding EDIFACT).

Communication via OFTP2 ready to be used (on Linux)


The only thing that is already decided and ready to be used is the OFTP2 communication (on Linux machine, OS4X by c-works if it matters, ODETTE ID assigned).

This way, message splitting or even parsing can use UNIX-based tools. Anyway...

MS SQL and procession on Microsoft Server


... the original message (before parsing) will also be saved on Microsoft based server (as a blob in the SQL table).

The database and the Enterprise applications is running on a different computer -- Microsoft Windows Server, MS SQL Server.

First messages to be processed


The Delivery schedule message (DELFOR) and Despatch advice message (DESADV) are the first one to be received. I am aware of versions of the EDIFACT messages (about two releases each year).

I am aware of X12 being the predecessor of EDIFACT, of the other standards like Tradacom, VDA, ... and the consequences of having tools for transformation of the messages. However, the decision was made to use the pure UN/EDIFACT only.

Differences based on a partner decisions


I am partly aware of (future) problems with _the same kind of message from a different …
0
Free Tool: Site Down Detector
LVL 9
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Recently I posted a question about to unmerge excel Sheet and one of expert solved my problem.Is it possible to unmerged all workbooks at one click?

Previous Question Link :

Previous Question
0
I am exporting a result file from software.Exported file have many merged rows and columns.I am facing trouble in extracting data from the workbook. I need a formula or VBA code which can unmerge all rows and columns.
Excel-20170731-17213317.xls
0
Hi EE,

For the following script see attached is there a method of implementing this that doesn't use the Cursor function.

Any assistance is appreciated.

Thank you.
Datadump.txt
0
Hi,

I am using Jupiter to write a read csv line.

So far,I wrote>>

(1)      import pandas as pd
(2)      pd.read_csv('C:/Users/USER1/Documents/Exports/ItemStatus.csv', sep=',')

but its giving me error. See text file. What I need to change to make this work…
python-read-error.txt
0
I have an Excel worksheet that has a Job Time Log # (Designated as JTL) in the upper left-hand corner on the front and back. I want to print multiple copies of the worksheet and index the JTL# by 1 with each copy. In other words, this run starts at 17001 (front and back), the next copy will be 17002 (front and back), then 17003 (front and back), etc.

Worksheet is attached.
New-JTL-Tax-Return-Rev19-EE.xlsx
0
Hi Experts,

EE provided assistance with the design of a form.

The form is functioning properly except that when I am preparing a record for addition after entering the data I have to do something to move off the record before it will be written to the table.  i.e. The Before Update Event is not being triggered after entering all of the data.

What may be causing this and what can be done to get it to write the record?

I am attaching a copy of the source.

Thanks.
Bob C.
2017-07-30-12.00----SAS-To-EE.accdb
0

Programming

52K

Solutions

40K

Contributors

Programming includes both the specifics of the language you’re using, like Visual Basic, .NET, Java and others, but also the best practices in user experience and interfaces and the management of projects, version control and development. Other programming topics are related to web and cloud development and system and hardware programming.