Posts by neuralgroove

    Re: Naming Freeform Objects

    not sure if this is what you're looking for. you should be able to change the name of the shape by just typing the new name in the Name Box you can do it through code too

    ActiveSheet.Shapes("Freeform 2").Select
        Selection.Name = "FunnyShape"
        Selection.ShapeRange.ScaleWidth 1.37, msoFalse, msoScaleFromTopLeft
        Selection.ShapeRange.ScaleHeight 1.4, msoFalse, msoScaleFromTopLeft
        Selection.ShapeRange.IncrementLeft -59.25
        Selection.ShapeRange.IncrementTop 83.25

    Re: Using a variable as a filename

    there are a number of alternatives for specifying the folder by this is the simplest

    Sub saveworkbookasinputfilename()
    saveasfilename = InputBox("Please Enter The name for the file", "Enter File Name")
    saveasfilefolder = "C:\Mypath\"
    ActiveWorkbook.SaveAs saveasfilefolder & saveasfilename & ".xls"
    End Sub

    Re: Using stored procedures with VBA

    this is a stripped down version of a procedure that I use that calls a stored procedure in access, so the connection strings would be different, but I think the recordset call would be in SQLServer

    Re: Reverse a list of names

    This should do it. Its not elegant, but make sure that NameColumn is set to the right column (ColumnA=1, Column B=2 etc)

    Re: Check cells and change others depending on value

    set ws1 and ws2 as your worksheet names and try this

    Re: Check cells and change others depending on value

    it looks like the rows and columns in your cells() statements are mixed up. If r is referring to the row, the it should be cells(r,8).select etc.
    I could be wrong, but this code is going to scan through row 8 in the first sheet up to the count of rows in columnb 8 and then change the values in row 1 of the next sheet.

    Re: Deleting rows with similar columns

    this will allow for blanks and delete rows if all the columns are blanks, not quite as elegant, but it does the job.

    Re: Deleting rows with similar columns

    when you are in the VB Editor, make sure the code is placed in a module in the same workbook. Open the Project Explorer window and locate your file, then click Insert -> Module and paste it there. Make sure you save your file before you run the macro just in case it does something you don't want it to do. Also make sure that the cell it is starting in isn't blank, or else it will end the macro.

    Re: Deleting rows with similar columns

    this should work. Makesure that it is starting in the right place ("A1" if there are no column headers, "A2" if there are). I called the calculation part because it will probably speed up the code.

    Re: getting the entire row from worksheet corresponding to a cell found

    actually, i thought about it for a second. If you have a listbox and you want rows and columns then you have to make a multicolumn listbox and import each cell individually. You can import a row into a listbox. If you need help with that then there are tons of posts in ozgrid and elsewhere on populating a multicolumn listbox.

    Re: Count letters till you get to a number

    as long as you data is in column "A" this should do the trick