adjust button output

ADRIANA P
ADRIANA P used Ask the Experts™
on
change the source" workbook. Currently when the 'One Column' button is clicked the data is transferred


should also be transferred to the COUNT sheet,
29119954c--1-_change_data_sources.xlsm
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Older than dirt
Most Valuable Expert 2017
Distinguished Expert 2018
Commented:
Try this.
29120038.xlsm
Fabrice LambertConsulting
Distinguished Expert 2017

Commented:
Well, well….

First: Give up hungarian notation, it provide nothing usefull.

Second, can you explain more about what you're trying to achieve ? I'm not sure to completly understand.
Where in the "Count" worksheet do you want your data ?

Third, this might be a better start:
Sub MultToOne()
    On Error Resume Next
    Dim rng As Excel.Range
    Set rng = Application.InputBox("Please select the range to be copied", , Range("C14").Address, Type:=8)
    On Error GoTo 0
    
    If rng Is Nothing Then
        MsgBox "No columns selected"
        Exit Sub
    End If
    If rng.Cells.Count < 2 Then
        MsgBox "No columns selected"
        Exit Sub
    End If
    
        '// retrieve input range values
    Dim data() As Variant
    data = rng.Value
    
        '// how many rows from input range
    Dim rows As Long
    rows = UBound(data, 1) - LBound(data, 1)
    
        '// how many columns from input range
    Dim columns As Long
    columns = UBound(data, 2) - LBound(data, 2)
    
        '// set target range start
    Dim trg As Excel.Worksheet
    Set trg = ThisWorkbook.Sheets("DTA")
    Set rng = trg.Range("A5")
        '// set target range the same size (rows and columns) as the data
    Set rng = trg.Range(rng, rng.Offset(rows, columns))
        '// write data
    rng.Value = data
End Sub

Open in new window

ADRIANA PACCOUNTING ASSISTANT

Author

Commented:
thanks   Martin and  Fabrice Lambert

for the fast and great response
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

ADRIANA PACCOUNTING ASSISTANT

Author

Commented:
Second, can you explain more about what you're trying to achieve ?

trying to have the

b2.PNG
Martin LissOlder than dirt
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
trying to have the [followed by picture]
I think you are giving Fabrice incorrect information. The COUNT sheet column 'L' problem was fixed in your previous question. He's asking what you want to have done in this question, which if I understand correctly, is to have the same data that goes to column 'A' on the DTA sheet, also go to column 'A' on the COUNT sheet and that is what my workbook attached above already does.
ADRIANA PACCOUNTING ASSISTANT

Author

Commented:
my correction

like  Martin say

this file adjustment was in the beginning as i say
Fabrice LambertConsulting
Distinguished Expert 2017

Commented:
I see.

Please, keep in mind that the more details in your question, the better our answer.
ADRIANA PACCOUNTING ASSISTANT

Author

Commented:
Fabrice Lambert you welcome !

im working on
ADRIANA PACCOUNTING ASSISTANT

Author

Commented:
Great Job!

Best Experts!!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial