+ Reply to Thread
Results 1 to 13 of 13

Thread: Syntax Error

  1. #1
    Registered User
    Join Date
    10-28-2011
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    17

    Syntax Error

    I have had a look about and i know what the problem is. I just dont know how to fix it.I am trying to get a macro to run down a column length decided by the user.( Cell = N 11)
    The column then does a simple equation an returns either a 1 or a 0. Ideally i would like it to do a lot more than this, but at the moment this is what i am stuck on.


    Dim i
    For i = 20 To 24
    
     Range("AH" & i).Select
    Application.ScreenUpdating = False
    Application.StatusBar = 100 * ((i - 1) / Range("C8")) & " %"
       ActiveSheet.Range("R" & i, "R" & i + Range("N11")).Select
       ActiveCell.FormulaR1C1 = "=IF(SUM(Range("R" & i, "R" & i + Range("N11")))=0,1,0)"
       
           Next i
    End Sub
    This is the macro i would like to work and is an imalgamation of the following two macros.

    Range("AH20").Select
        ActiveCell.FormulaR1C1 = "=IF(SUM(R[4]C[-16]:R[24]C[-16])=0,1,0)"
        Range("AH21").Select
    End Sub

    For i = 24 To Range("C7") + 1
    Application.ScreenUpdating = False
    Application.StatusBar = 100 * ((i - 1) / Range("C7")) & " %"
        Range("A" & i).Select
        Range(ActiveCell, ActiveCell.Offset(0, 2)).Copy
        Range("A" & i).Offset(0 + (4 * (i - 24)), 17).Select
        ActiveSheet.Paste

    Any help would be greatly appreciated as the file i am developing is far outside my capabilities at the moment, and it is a rather steep learning curve.
    Thanks
    RB
    Last edited by Richard Brook; 11-14-2011 at 09:01 AM.

  2. #2
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,631

    Re: Syntax Error

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

  3. #3
    Registered User
    Join Date
    10-28-2011
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Syntax Error

    Attatched (hopefully) is a Dummy workbook.
    This is simplified with a few notes to help limit confusion.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    10-28-2011
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Syntax Error

    Bump- (need help on this asap)

  5. #5
    Registered User
    Join Date
    10-28-2011
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Syntax Error

    Double Bump- Anyone have any ideas? Anything at all?

  6. #6
    Registered User
    Join Date
    10-28-2011
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Syntax Error

    Triple bump- Anybody even know if this is possible?

  7. #7
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,631

    Re: Syntax Error

    Your formula in the code won't work like that what is actually supposed to be on the sheet?

    Why not just use the formula on the sheet?
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

  8. #8
    Registered User
    Join Date
    10-28-2011
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Syntax Error

    What i am trying to develop is a macro to find a data gap of a set period.
    The user specify, for example, 3 data gaps. the Macro will then search through the values and return the amount of data gaps of appropriate size.

  9. #9
    Registered User
    Join Date
    10-28-2011
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Syntax Error

    bump-yet again

  10. #10
    Registered User
    Join Date
    10-28-2011
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Syntax Error

    bump- any more bumps and i might just cry!

  11. #11
    Registered User
    Join Date
    10-28-2011
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Syntax Error

    bump- any body any ideas?

  12. #12
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,631

    Re: Syntax Error

    I asked what you expect the formula on the sheet to be.

    It seems like an example would help

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook. Don't upload a picture when you have a workbook. None of us is inclined to recreate your data. Upload the workbook and manually add an 'after' situation so that we can see what you expect. In addition clearly explain how you get the results.

    To attach a file to your post, you need to be using the main 'New Post' or 'New Thread' page and not 'Quick Reply'.
    To use the main 'New Post' page, click the 'Post Reply' button in the relevant thread.

    On this page, below the message box, you will find a button labelled 'Manage Attachments'.
    Clicking this button will open a new window for uploading attachments.

    You can upload an attachment either from your computer or from another URL by using the appropriate box on this page.
    Alternatively you can click the Attachment Icon to open this page.

    To upload a file from your computer, click the 'Browse' button and locate the file.

    To upload a file from another URL, enter the full URL for the file in the second box on this page.
    Once you have completed one of the boxes, click 'Upload'.

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

  13. #13
    Registered User
    Join Date
    10-28-2011
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Syntax Error

    I have already attatched a dummy work book, i shall attach it again
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0