+ Reply to Thread
Results 1 to 5 of 5

Push jump to next row in macro

  1. #1
    Registered User
    Join Date
    10-12-2019
    Location
    Poland
    MS-Off Ver
    2010
    Posts
    31

    Push jump to next row in macro

    Hi,

    I am new in the topic of VBA and macro. I have problem with making a loop on the search & replace function.

    I have the code:

    PHP Code: 
    Sub CommmandButton1Click()

    For 
    2 To 36

    Worksheets
    ("Arkusz1").Range("J2:J37").Select

    Selection
    .Replace What:="xxx"Replacement:=Cells(i2).Value_
    LookAt
    :=xlPartSearchOrder:=xlByRowsMatchCase:=False

    Selection
    .Replace What:="---"Replacement:=Cells(i3).Value_
    LookAt
    :=xlPartSearchOrder:=xlByRowsMatchCase:=False

    Selection
    .Replace What:=";;;"Replacement:=Cells(i4).Value_
    LookAt
    :=xlPartSearchOrder:=xlByRowsMatchCase:=False

    Next

    Worksheets
    ("Arkusz1").Cells(11).Select

    End Sub 
    It is copying and replacing values from 2nd, 3rd and 4th column and puts in the cell under specific line of characters the values. The problem is that it is copying with the same data for all rows further. How to force jumping to next row?

    Can you please help?

    Reagrds,
    Jakub
    Last edited by cosiek; 10-12-2019 at 07:18 AM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Push jump to next row in macro

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    10-12-2019
    Location
    Poland
    MS-Off Ver
    2010
    Posts
    31

    Re: Push jump to next row in macro

    Thank you very much for this reply. It was really helpful!

    I have also such questions, maybe you know the answer, as want to improve the quality of work for my wife, who has to send similar mails to multiple individuals:

    1. How can I change below to have flexible?
    HTML Code: 
    to
    HTML Code: 
    2. How can I rerun the mentioned above macro? Let's say my wife forgot to correct the name of individual and need to have the mail template populated once again. Can we somehow have it rerun?

    3. How can I add macro, which will copy paste the populated template of text from (J2:till is populated), add mails in section TO in mail message from the same row (F2:till is populated) and add have predefined subject of mail for Outlook application?

    Appreciate your help in understanding that.

    Regards,
    Jakub

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Push jump to next row in macro

    Please Login or Register  to view this content.
    I don't understand #2 and#3. Ask them in a NEW thread with more details and attach an example workbook.

  5. #5
    Registered User
    Join Date
    10-12-2019
    Location
    Poland
    MS-Off Ver
    2010
    Posts
    31

    Re: Push jump to next row in macro

    Thank you. Sure, will do.

+ 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. Macro to push excel workbooks to bitbucket repository
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-07-2018, 03:10 AM
  2. changing the image from the create sheet push button for macro
    By zei in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-03-2017, 05:17 PM
  3. Replies: 4
    Last Post: 02-09-2015, 05:20 PM
  4. Replies: 5
    Last Post: 09-16-2014, 12:17 PM
  5. [SOLVED] Macro to push the results of all formulae on multiple worksheets to another workbook
    By sraon in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-28-2014, 11:15 AM
  6. Macro to push blank data field records in the end.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-05-2013, 11:46 AM
  7. Replies: 0
    Last Post: 12-05-2012, 02:18 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