mridley1013
mridley1013

Reputation: 21

VBA macro to select cell based on row and column criteria

I'm trying to create a macro that runs with a custom user form shown below. My ultimate goal is to have the Expenditure Category radial select the sheet in the file, then have the PO Number field search column A of the selected sheet to find a match, then subsequently have the Week Ending Date field search row 7 to find a match for the date entered. Where these two intersect (i.e. CN72) is where I want to input what is put in Accrual Amount. I have no idea about how to go about doing this, so any help would be great!

enter image description here

Upvotes: 0

Views: 1286

Answers (1)

Pike7893
Pike7893

Reputation: 80

It is a loop inside another loop...I might use something like this..

x = 1
z = 1
datexx = [input]
POnumber = [input]
do

  do

if Sheets("[name]").Range("[column]" & z) = Sheets("[name]").Range("[column]" & x) then
'do your stuff here
end if
z = z +1 
loop until isempty(Sheets("[name]").Range("[A column that is never empty for all data]" & z) 
x = x+ 1
loop until isempty(Sheets("[name]").Range("[A column that is never empty for all data]" & x) 

Upvotes: 0

Related Questions