+ Reply to Thread
Results 1 to 6 of 6

Silly Starter questions

  1. #1
    Registered User
    Join Date
    09-04-2019
    Location
    Berlin
    MS-Off Ver
    2016
    Posts
    3

    Silly Starter questions

    Hello Guys,

    I have 3 questions:

    1. I've written the following code but I keep getting "next without for" compile error:
    Sub Main()
    Dim i As Integer
    For i = 1 To 11
    If Cells(4, i).Value <> "" Then
    Next i
    Else
    Exit For
    End If
    Cells(5, i - 1).Value = "Here"
    End Sub

    Any ideas where I was I wrong?

    2. If I want something to run on start up, without clicking anything, I just put the function under sub main() ?
    3. I have an image on the worksheet, and I would like to set its location on start up based on some conditions. How do I do it as I don't know the image's name/property... ?

    Thanks a bunch,
    Ron
    Last edited by Assemblage; 09-04-2019 at 07:10 AM.

  2. #2
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Silly Starter questions

    what is your code supposed to do??
    in wrong order
    Please Login or Register  to view this content.
    if to run on open has to be put into Worksheet Open event module

  3. #3
    Registered User
    Join Date
    09-04-2019
    Location
    Berlin
    MS-Off Ver
    2016
    Posts
    3

    Re: Silly Starter questions

    It works, thanks alot!
    The code is supposed to read a line of data, recognize where the data ends (cells are empty onwards), and then write a "Here" below the last cell that includes data in it.

    Under worksheet, I do not see an "Open" event. I have Activate, BeforeDelete etc...
    Last edited by Assemblage; 09-04-2019 at 06:25 AM.

  4. #4
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Silly Starter questions

    in vba editor click on this workbook and select 'workbook open'
    Attached Images Attached Images
    Last edited by nigelog; 09-04-2019 at 07:05 AM.

  5. #5
    Registered User
    Join Date
    09-04-2019
    Location
    Berlin
    MS-Off Ver
    2016
    Posts
    3

    Re: Silly Starter questions

    Changed to [Solved].

    Thanks alot for your help guys.

    Ron

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Silly Starter questions

    Assemblage, welcome to the forum

    For future reference, please use thread titles that are descriptive of your problem.

    Also, please use code tags when posting code, it makes it easier to see/understand. See my notes on my signature on how to do that.

    Thanks
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hi - New starter
    By carrieuk in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 10-31-2014, 05:19 AM
  2. Excel Starter
    By Telegraph Sam in forum Excel General
    Replies: 5
    Last Post: 10-18-2014, 09:05 AM
  3. layout of excel 2010 starter
    By pclum in forum Excel General
    Replies: 2
    Last Post: 09-12-2011, 09:58 AM
  4. Best book for absolute starter to VBA??
    By amygdalus in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-08-2010, 10:11 PM
  5. Starter Code
    By MIMITW in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-06-2010, 09:18 AM
  6. Problems of a starter
    By DOSTOYEVSKY1954 in forum ExcelTip.com Feedback / Comments / Suggestions
    Replies: 1
    Last Post: 08-23-2009, 05:25 AM
  7. Silly Questions
    By Tania Mann in forum Excel General
    Replies: 1
    Last Post: 02-21-2005, 06:01 PM

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.6.0 RC 1