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: Most helpful
  1. Anonymous
    2023-03-07T19:02:55+00:00

    Actually, I just saw the teams meeting link from the post on the 5th

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2023-03-07T19:00:48+00:00

    Jeovany,

    I used the previous meeting link since there was not a new one posted. Please let me know if that is not what I should have done.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2023-03-06T18:38:50+00:00

    Jeovany

    Thank you for sending the files, I will take a look at them. I have already implement the creating a sold item list to my code, so I will be interested in comparing my approach to yours. I would be able to meet with on on Tuesday if that works. I should be good to meet at anytime. Please let me know what works best for you.

    That's Great.

    We can meet tomorrow Tuesday at 7 pm London time.

    Regards

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2023-03-06T15:28:18+00:00

    Jeovany

    Thank you for sending the files, I will take a look at them. I have already implement the creating a sold item list to my code, so I will be interested in comparing my approach to yours. I would be able to meet with on on Tuesday if that works. I should be good to meet at anytime. Please let me know what works best for you.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2023-03-06T01:39:01+00:00

    Hi Tim

    I hope you are OK,

    You may find in this link a folder with files regarding your project. TIM's Project

    Looking forward to meeting you again via Video Chat this week,

    I will be available Monday the 6th, Tuesday the 7th, and Thursday the 9th after 7 pm London time.

    Here is the link for the meeting https://teams.live.com/meet/9417484056781

    Regards

    Jeovany

    Was this answer helpful?

    0 comments No comments