Using the find In VBA

Anonymous
2023-02-09T14:01:31+00:00

I am trying to write a macro that will deduct an item from my stock (which is housed in a different workbook) when I hit the complete button. My thoughts were to use the find function, activate the cell, and then subtract the quantity from the active cell. I am just starting with the macro, but I am running into an object error with my find.

Sub Deduct()

Dim C As String

'Deduct the Quantity from Stock

Workbooks.Open "C:\Users\furnd\Desktop\Test Deduct.xlsm"

With Workbooks("Test Deduct.xlsm").Sheets("Sheet1").Range("A1:A2000")

Set C = .Find(What:="A1").Value

End With

Workbooks("Test Deduct.xlsm").Activate

Sheets("Sheet1").Select

C.Offset(0, 1).Select

End Sub

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

47 answers

Sort by: Oldest
  1. Anonymous
    2023-02-23T19:44:55+00:00

    Thank you for meeting with me on Tuesday. I have discussed some of your ideas with my boss and he is very intrigued by your idea to have incoming and out going fields with an initial stock and a current stock. I feel like maybe I didn't pay as much attention to that as I should have. Now I am having some issues with how I would go about programming that. Would it be possible for me to see those files and see if I can work my way through them or possibly meet over video chat to talk about them?

    Hi Tim

    Yes, sure no problem.

    I'll create the files, and show you how it works.

    Regards

    Jeovany

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2023-02-28T23:53:28+00:00

    Hi Tim

    I've been very busy at work plus some home projects

    But I finally got the files done and working as intended.

    We could meet on Thursday at 7 pm London time via Video chat

    which link I'll post later.

    Thank you for being so patient

    Kind regards

    Jeovany

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2023-03-02T04:09:23+00:00

    tomorrow at 7pm London time will work great.

    Thank you again

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2023-03-02T13:32:03+00:00

    Jeovany,

    We are short handed at work today. Is there anyway we can push this meeting until next week?

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2023-03-02T18:21:55+00:00

    OK, No problem

    Next week then.

    I'll send you via WETRANSFER the folder with the project files and macros

    Regards

    Jeovany

    Was this answer helpful?

    0 comments No comments