copy data to specific cell based on user input

jamshoot

Board Regular
Joined
Oct 15, 2009
Messages
199
Hi all

I struggling to have a macro that allow me to copy data to specific cell based on user input.
Example:

I have "X" data in A2
I need a macro prompt to enable user to input how many "X" to copy & paste to cell
I am looking at the user will first have the cursor at A2 & then click a button (with macro) which prompt how many X to copy & paste.
The offset to paste is fixed, ie. in column C, E & G
Then if the User want to repeat for A3, the process is repeat as above.


A1 B1 C1 D1 E1 F1 G1 H1
A2 X X X X
A3 X X

Anyone can help me

Cheers
 
Not sure I'm understanding your request, but here's how your would show Only records with numerics in Column A. After running, you would have to, of course "unhide" the hidden rows manually, unless you do another macro to accomplish this for you. Good Luck Jim

Code:
Sub ShowNumbersOnly()
LR = Range("A" & Rows.Count).End(xlUp).Row
Set Rng = Range("A1:A" & LR)  'assumes your data starts on row 1
For Each C In Rng
    If Not IsNumeric(C) Then
    C.EntireRow.Hidden = True
    End If
Next C
End Sub
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Not sure I'm understanding your request, but here's how your would show Only records with numerics in Column A. After running, you would have to, of course "unhide" the hidden rows manually, unless you do another macro to accomplish this for you. Good Luck Jim

Code:
Sub ShowNumbersOnly()
LR = Range("A" & Rows.Count).End(xlUp).Row
Set Rng = Range("A1:A" & LR)  'assumes your data starts on row 1
For Each C In Rng
    If Not IsNumeric(C) Then
    C.EntireRow.Hidden = True
    End If
Next C
End Sub

Hi Jim

The macro works perfectly. But I am stuck on how to use macro to unhide it.
Appreciate if u can help.
cheers
 
Upvote 0

Forum statistics

Threads
1,215,491
Messages
6,125,102
Members
449,205
Latest member
ralemanygarcia

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top