Posts by lambuhere1

    You can make some modifications to the following code to meet your requirements.

    Dim oChart As Chart
    ActiveSheet.ChartObjects("Chart 2").Activate
    Set oChart = ActiveChart
    gifname = InputBox("Enter name for GIF:")
    oChart.Export "C:\Windows\Desktop\" & gifname & ".gif", FilterName:="GIF"


    Added to what has been said by Experts in here,

    Here are my comments.

    You can use the following code in Workbook_open event. All these are set to False. What it does is it disables the icons and menu bar for File. You can tweak the code to include all your menu bars.


    Application.CommandBars("Worksheet Menu Bar").Controls.Item("File").Enabled = False
    Application.CommandBars(3).Enabled = False


    Some more thoughts.

    You name your calculator file with a specific name. When you open the workbook and if the filename is not the same as you has sent to the clinet, the workbook shall close automatically

    Other option is when your client opens your workbook, DISABLE ALL THE MENUBARS IN EXCEL APPLICATION so that your client cannot make any copy of it. ENABLE ALL THE MENUBARS AND BUTTONS WHEN THE WORKBOOK GETS CLOSED.

    Just few thoughts on your issues!!! Probably others can shed more light on it.:guitar:

    I would do in this way. I know the path on the particular specific machine where I want the file to be opened. I shall hard wire in the workbook open event. If this file is copied and stored in a different folder and If this is not the path set in the code, The workbook shall not open.

    Good Luck.



    Thanks for your reply.

    Do I need to have the Adobe Distiller Installed? If so, Can you kindly tell me the procedure. If I need to buy the installer, I may explore this option.


    Hi Xl-Dennis

    When I tried to use the add-in, I get the error in line

    Dim objDistiller As New ACRODISTXLib.PdfDistiller

    Do I need to check in any references?


    You can use the following code to import data with more than 65536 rows into Excel. After import, You can use the text-column feature in Excel to make the data the way you want to .

    Good Luck :cheers:

    Sub ImportText_file()
    Dim ResultStr As String
    Dim FileName As String
    Dim FileNum As Integer
    Dim Counter As Double
    FileName = InputBox("Please enter the Text File's name with its path, e.g. c:\test.txt")
    'If Error Then End
    If FileName = "" Then End
    FileNum = FreeFile()
    Open FileName For Input As #FileNum
    Application.ScreenUpdating = False

    Workbooks.Add template:=xlWorksheet
    Counter = 1
    Do While Seek(FileNum) < LOF(FileNum)

    Application.StatusBar = "Importing Row " & _
    Counter & " of text file " & FileName
    Line Input #FileNum, ResultStr
    If Left(ResultStr, 1) = "=" Then
    ActiveCell.Value = "'" & ResultStr

    ActiveCell.Value = ResultStr
    End If

    If ActiveCell.Row = 65536 Then
    ActiveCell.Offset(1, 0).Select
    End If
    Counter = Counter + 1

    Application.StatusBar = False

    End Sub

    You can extract data with more than 65536 rows into Excel. Only limitation shall be the data shall be in a new worksheet. If it is ok with you, do let me know. I shall be sending you the code.

    Probably you are extracting this text data from a commercial software!!1

    Ram P:cheers:

    In addition to what Yogendra helped you out with, You can copy the cell data from your DATA Sheet into a new workbook using pastespecial feature to copy only the values ( this takes care of your validation issue!!!) and then use Yogendra's code to save the exported worksheet data.

    Hope this helps.

    Ram P

    Hi Experts

    I would like to extract data from selected points in rows. How can I do that. Let me explain you a bit more.

    I have data in two columns. Col A contains Time in seconds, Col B Temperature

    Col A Col B
    3000 23
    3290 68
    4020 89
    4590 98
    5210 98

    And It goes on

    I would like to Extract Data at selected time intervals. For e.g, If i need to extract the data at every 1000th interval or close to that, How can I do that? I am using VBA and Excel 2000 SP3.

    Thanks for your help.

    Ram P

    I am sending you a file. I hope this meets y our requirements.

    Ram P

    Step by Step procedure is given below.

    Assuming all the labels are in Column A and data for mappping is in always B,C, Kindly do the following.

    Insert a column between B, C

    To get data in New column C, make it =data in column B.

    For e.g, in cells C2, Press = and then click B2.

    Drag this function to all the valid data in Column B.

    Select the data in Column C and define a range by going to Insert-Name - Define. (In the code below, I have defined it as xx. You can change it according to your requirements.)

    Now, we have to assign labels (which are in Col A ) to that in Column C. For this you can run the following Macro.

    Sub assign_labels()
    For Each cell In Range("xx")
    fmt = """" & cell.Offset(0, -2).Value & """"
    cell.NumberFormat = fmt
    Next cell
    End Sub

    You will see that you get all the labels assigned from Col A to Col C. But the data is linked to Col B. Only their style has been changed.

    Now you can plot the graph , x - y scatter, sub-graph 1, By selecting Col C and Col D. (Do not select the Col B which has original Data!!!).

    Plot it by the chart wizard, But include the option, Show Data labels under Data labels tab of chart wizard.

    You can see all the labels on the graph which you want to see.

    But you also see the first condition as the x-axis of the graph. You need to change this.

    Select X-axis of the graph. Right Click and select format axis.

    Select Number tab and then select Number. Make decimal places 0 and Press OK.
    Now the graph looks the way you want to.:-)