Problem getting info to transfer

R

Rob Hargreaves

Hi I have a worksheet as a form.

This is how the form is laid out.

Date

Input A - Always column E
Input B - Always Column F
Input C - Always Column G
and so on..

The date input always decides the row to input the data
to. The date is always in Column B on my data sheet.

Set Rng = Range("E" & Application.Match(Range("D6"), Range
("B:B"), 0))
Rng.Value = Application.Worksheets("Daily").Range
("D8").Text

So in the above I have "E" because this is relating to
Input A and will go in column E.

I have "D6" because thats where the date on the form is
held on the worksheet. B:B because the date is always in
column B and D8 where I want to output Input A into.

I am having great difficulty in getting this to work.
Even for one input textbox. And I have about 12!!

I am trying to get it to work from a button on the form
sheet so when I click on the button the information will
transfer to the sheet "Daily" to whatever column I
specify whether information is already in that cell or
not.

Can you help??

I know I probably need a

Dim Rng As Range

at the top of the procedure but I am lost.

Thanks

Rob
 
T

Tom Ogilvy

I should have put clng around Range("D6"). so it would be clng(Range("D6")
if that doesn't clear it up, then perhaps some of the ranges are on
different sheets.
I don't know where your data is, but as I said, you might need to qualify
the ranges. Lets assume all the ranges are on Daily, but daily won't be
the activesheet. Then

set sh = Worksheets("Daily")

Set Rng = sh.Range("E" & Application.Match( _
clng(sh.Range("D6")), sh.Range("B:B"), 0))
Rng.Value = sh.Range("D8").Text

But perhaps that is not the case. If column B with the dates were on a sheet
call DATA and the other ranges on Daily then

set sh = Worksheets("Daily")
set shData = Worksheets("Data")

Set Rng = sh.Range("E" & Application.Match( _
clng(sh.Range("D6")), shData.Range("B:B"), 0))
Rng.Value = sh.Range("D8").Text

So you would make similar type adjustments to match your actual situation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top