How to add empty rows to the JQGrid?

I want to add one space to all rows of excel worksheet.?

  • There are many rows in the excel file. Entry is only in first column of the worksheet, rest of the worksheet is blank. Total characters in the cells of first column are 749. I need to make all the rows with 750. I have to add one space at the end of each entry to make it 750. How can I do this ? I do not want to edit each cell and add a space at the end manually since there are about 1000 rows. Any suggestions ?

  • Answer:

    You can use the following event handler to automatically add a 'space' at the end of each string. However, this presupposes that your data in each cell is alphanumeric, not numeric. If numeric, Excel will eliminate the space. Copy the following event handler to the clipboard (highlight the entire code, right click inside the highlighted area, and 'Copy'). Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim i, LastRow LastRow = Range("A" & Rows.Count).End(xlUp).Row For i = 1 To LastRow Cells(i, "A").Value = Cells(i, "A").Value & " " Next End Sub Select the worksheet containing the data to evaluate and right click the sheet tab. Select 'View Code'. Paste the event handler into the white editing area to the right (right click inside the area and 'Paste'). Close the VBE (red button w/white 'x') To add the space, double click any cell in the worksheet.

SG at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.