+ Reply to Thread
Results 1 to 3 of 3

Have a problem writing a macro that works

  1. #1
    Registered User
    Join Date
    01-16-2022
    Location
    Bebington,England
    MS-Off Ver
    365
    Posts
    4

    Have a problem writing a macro that works

    Hi
    I am new at using VBA macros and having problems understanding some of the methods

    I am hoping that with the collective expertise of the forum I can not only solve my problem but learn more about VBA and increase my circle of friends

    Have a great day

    Arnold Smailes

    (Arnie)

    I am working on a set of spare part control cards (68 individual cards) which have inputs in column “B” for the Quantity Sold and column “C” for the date sold. The quantity and dates are to be picked up from cells “P1” for the Quantity and “Q1” for the date.

    The stock card to be selected for the input comes from cell “R7” This cell gives the item number (ie. The card number to have an entry made)

    The existing macro below selects the right stock card numbered in range “R7” and places the cursor on the first entry row in column “B”

    I now want to enter the quantity sold and the date in the next empty cell down.
    HOWEVER no matter what I try I cannot get the cursor to move beyond Worksheets("Nail Cards").Range("C2:C4012").Find(Range("R7").Value).Offset(8, -1).Select.

    The following last part of the macro is what I thought would input the data into the appropriate cells but does not appear to activate

    Lrow = Worksheets("Nail Cards").Range("B" & Rows.Count).End(xlUp).Row + 1
    Worksheets("Nail Cards").Range("B" & Lrow & ":C" & Lrow) = Worksheets("Nail Cards").Range("P1:Q1").Value

    End Sub

    My apologies but I am new at VBA macros and will no doubt be overlooking something obvious.
    Attached Files Attached Files
    Last edited by Arnold Smailes; 01-16-2022 at 09:15 AM. Reason: missing text

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166
    Hello Arnold Smailes,

    Welcome to Excelforum. Be a part of large Excel community. Enjoy Learning.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Have a problem writing a macro that works

    Hi Arnold,

    Please read the description of this sub-forum - this one is solely to introduce yourself.

    So here I'd say: welcome to the forum. And that's it.

    With your merit question, please go to appropriate sub-forum. Look what sub-forums we have: http://www.excelforum.com/microsoft-...el-help-forum/ and post a new thread in one of them (the most appropriate one).

    Probably the macro sub-forum will be most suitable, but let me say 2 more sentences:
    1) The attached file is xlsx - so for sure there are no macros inside
    2) please observe forum rules about using CODE tags while posting code the rules are here: https://www.excelforum.com/forum-rul...rum-rules.html
    Best Regards,

    Kaper

+ 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. Problem with recording a macro with long formula - works in Excel but not in macro
    By tonybeo2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-28-2015, 11:25 AM
  2. [SOLVED] Problem with hyperlink macro. Works but has a defect.
    By DenisBrochu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-27-2013, 12:35 PM
  3. [SOLVED] Macro with Problem to Sum Time, but If I use =value+value+value works..
    By feroguz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-30-2012, 04:39 PM
  4. problem with macro - works in 2003, debugs in 2007 - help!
    By F5JASON in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-17-2012, 02:19 PM
  5. Vlookup works while writing macro - gives err msg when executed
    By dalewms2 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-30-2011, 01:15 PM
  6. Problem with check writing macro
    By Mister P in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-30-2011, 11:20 AM
  7. Problem with macro that works on multiple workbooks
    By vandalizmx in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-13-2007, 11:36 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