+ Reply to Thread
Results 1 to 6 of 6

VBA UseForm

  1. #1
    Forum Contributor
    Join Date
    07-27-2017
    Location
    Dhaka
    MS-Off Ver
    MS Excel 2019/ 64 bit
    Posts
    159

    VBA UseForm

    Dear Experts,
    I want to make a useform for data entry in my excell sheet. there are three button in my useform. No 1: its a combo box & i select data from here. No 2: Its a date picker & select date from here. No 3: Its comand button & caption save & update. Now if i fill all data in useform & if i click comand button then data will save & close the useform. combo box data will save a1 cell & date picker data will save c1 cell. but if a1 & c1 cell already have any data then my saved data will go next cell that means A2 & c2 Cell. what code i use for this. please help me.

    Best regards
    Wahid

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: VBA UseForm

    Use a variable that captures the next available row number and use the variable in the Click Comman button code

    Personally I tend to use an Excel cell that typically holds a COUNTA() function that results in the next row and read that cell into a VBA variable.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    07-27-2017
    Location
    Dhaka
    MS-Off Ver
    MS Excel 2019/ 64 bit
    Posts
    159

    Re: VBA UseForm

    Dear Expert,
    I am not clear. please help me in details.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: VBA UseForm

    What aren't you clear about?

    What answer do you get when you use =COUNTA(A:A)
    What's the next blank cell in column A?

    Upload your workbook if you want specific advice.

  5. #5
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Re: VBA UseForm

    Dear Rachel,

    I think I know exactly what you want.

    At the start of the Command_Button, please add the following code:

    Please Login or Register  to view this content.
    The outlined numbers corresponds to the cells (1 = A; 2 = B and so on.)

    The iRow line looks for the next empty cell and writes on that row.

    Let me know if that worked.

    Best regards,
    Filipe

  6. #6
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: VBA UseForm

    Cross Posted : https://www.mrexcel.com/forum/excel-...a-useform.html

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

+ 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. Adding a textbox to a useform upon clicking on a button in the useform.
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-29-2016, 08:16 AM
  2. VBA Useform
    By JOONA in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-05-2013, 05:43 AM
  3. Update from Useform
    By doglover in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-04-2013, 12:09 AM
  4. Emailing from a useform
    By Bigsam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2012, 09:06 AM
  5. Useform Build
    By AndyE in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-03-2010, 12:22 AM
  6. Listbox on a useform
    By ingleg in forum Excel General
    Replies: 4
    Last Post: 07-06-2006, 04:27 AM
  7. [SOLVED] useform with flexibel textfield
    By Siegfried in forum Excel General
    Replies: 3
    Last Post: 04-24-2005, 02:06 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